this tests whether merging works correctly with the count trigger

public void test session windows with count trigger ( ) throws exception { close called set ( 0 ) ; final int session size = 3 ; list state descriptor < tuple 2 < string , integer > > state desc = new list state descriptor < > ( " window - contents " , string int tuple create serializer ( new execution config ( ) ) ) ; window operator < string , tuple 2 < string , integer > , iterable < tuple 2 < string , integer > > , tuple 3 < string , long , long > , time window > operator = new window operator < > ( event time session windows with gap ( time seconds ( session size ) ) , new time window serializer ( ) , new tuple key selector ( ) , basic type info string type info create serializer ( new execution config ( ) ) , state desc , new internal iterable window function < > ( new session window function ( ) ) , purging trigger of ( count trigger of ( 4 ) ) , 0 , null / * late data output tag * / ) ; one input stream operator test harness < tuple 2 < string , integer > , tuple 3 < string , long , long > > test harness = create test harness ( operator ) ; concurrent linked queue < object > expected output = new concurrent linked queue < > ( ) ; test harness open ( ) ; / / add elements out - of - order test harness process element ( new stream record < > ( new tuple 2 < > ( " key 2 " , 1 ) , 0 ) ) ; test harness process element ( new stream record < > ( new tuple 2 < > ( " key 2 " , 2 ) , 1000 ) ) ; test harness process element ( new stream record < > ( new tuple 2 < > ( " key 2 " , 3 ) , 2500 ) ) ; test harness process element ( new stream record < > ( new tuple 2 < > ( " key 2 " , 4 ) , 3500 ) ) ; test harness process element ( new stream record < > ( new tuple 2 < > ( " key 1 " , 1 ) , 10 ) ) ; test harness process element ( new stream record < > ( new tuple 2 < > ( " key 1 " , 2 ) , 1000 ) ) ; / / do a snapshot , close and restore again operator subtask state snapshot = test harness snapshot ( 0l , 0l ) ; test harness close ( ) ; expected output add ( new stream record < > ( new tuple 3 < > ( " key 2 - 10 " , 0l , 6500l ) , 6499 ) ) ; test harness util assert output equals sorted ( " output was not correct " , expected output , test harness get output ( ) , new tuple 3 result sort comparator ( ) ) ; expected output clear ( ) ; test harness = create test harness ( operator ) ; test harness setup ( ) ; test harness initialize state ( snapshot ) ; test harness open ( ) ; test harness process element ( new stream record < > ( new tuple 2 < > ( " key 1 " , 3 ) , 2500 ) ) ; test harness process element ( new stream record < > ( new tuple 2 < > ( " key 1 " , 1 ) , 6000 ) ) ; test harness process element ( new stream record < > ( new tuple 2 < > ( " key 1 " , 2 ) , 6500 ) ) ; test harness process element ( new stream record < > ( new tuple 2 < > ( " key 1 " , 3 ) , 7000 ) ) ; test harness util assert output equals sorted ( " output was not correct " , expected output , test harness get output ( ) , new tuple 3 result sort comparator ( ) ) ; / / add an element that merges the two " key 1 " sessions , they should now have count 6 , and / / therefore fire test harness process element ( new stream record < > ( new tuple 2 < > ( " key 1 " , 10 ) , 4500 ) ) ; expected output add ( new stream record < > ( new tuple 3 < > ( " key 1 - 22 " , 10l , 10000l ) , 9999l ) ) ; test harness util assert output equals sorted ( " output was not correct " , expected output , test harness get output ( ) , new tuple 3 result sort comparator ( ) ) ; test harness close ( ) ; }


visit a parse tree produced by { @ link painless parser # callinvoke }

t visit callinvoke ( painless parser callinvoke context ctx ) ;


returns the fingerprint of the public key

public string get fingerprint ( ) { return key utils fingerprint ( instance identity provider rsa get public key ( ) ) ; }


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


compare < code > d 1 < code > against < code > d 2 < code > , pushing { @ value double # na n } at the bottom

public static int compare discard na n ( double d 1 , double d 2 , boolean asc ) { if ( double is na n ( d 1 ) ) { return double is na n ( d 2 ) ? 0 : 1 ; } else if ( double is na n ( d 2 ) ) { return - 1 ; } else { return asc ? double compare ( d 1 , d 2 ) : double compare ( d 2 , d 1 ) ; } }


public void set commit method ( method commit method ) { this commit method = commit method ; }


short - circuit ? : no threadsemaphore : thread thread pool full ? : no thread pool queue full ? : no timeout : no execution result : success

public void test execution hook thread success ( ) { assert hooks on success ( new func 0 < test hystrix command < integer > > ( ) { @ override public test hystrix command < integer > call ( ) { return get command ( execution isolation strategy thread , abstract test hystrix command execution result success ) ; } } , new action 1 < test hystrix command < integer > > ( ) { @ override public void call ( test hystrix command < integer > command ) { testable execution hook hook = command get builder ( ) execution hook ; assert true ( hook command emissions match ( 1 , 0 , 1 ) ) ; assert true ( hook execution events match ( 1 , 0 , 1 ) ) ; assert true ( hook fallback events match ( 0 , 0 , 0 ) ) ; assert equals ( " on start - on thread start - ! on run start - on execution start - on execution emit - ! on run success - ! on complete - on emit - on execution success - on thread complete - on success - " , hook execution sequence to string ( ) ) ; } } ) ; }


gets the type of the key by which the data set is partitioned

type information [ ] get key types ( ) ;


pulling the messages in a async way support message selection

void pull ( final message queue mq , final message selector selector , final long offset , final int max nums , final pull callback pull callback , long timeout ) throws m q client exception , remoting exception , interrupted exception ;


get the set of core cache keys associated with the given index

public synchronized set < object > get core keys for index ( string index ) { final set < index reader cache key > objects = index to core key get ( index ) ; if ( objects = = null ) { return collections empty set ( ) ; } / / we have to copy otherwise we risk concurrent modification exception return set copy of ( objects ) ; }


method to perform depth - first search and write the parameters of every queue in json format

private static void dump configuration ( json generator dump generator , set < queue > root queues ) throws json generation exception , i o exception { for ( queue queue : root queues ) { dump generator write start object ( ) ; dump generator write string field ( " name " , queue get name ( ) ) ; dump generator write string field ( " state " , queue get state ( ) to string ( ) ) ; access control list submit job list = null ; access control list administer jobs list = null ; if ( queue get acls ( ) ! = null ) { submit job list = queue get acls ( ) get ( to full property name ( queue get name ( ) , queue a c l submit job get acl name ( ) ) ) ; administer jobs list = queue get acls ( ) get ( to full property name ( queue get name ( ) , queue a c l administer jobs get acl name ( ) ) ) ; } string acls submit job value = " " ; if ( submit job list ! = null ) { acls submit job value = submit job list get acl string ( ) ; } dump generator write string field ( " acl submit job " , acls submit job value ) ; string acls administer value = " " ; if ( administer jobs list ! = null ) { acls administer value = administer jobs list get acl string ( ) ; } dump generator write string field ( " acl administer jobs " , acls administer value ) ; dump generator write field name ( " properties " ) ; dump generator write start array ( ) ; if ( queue get properties ( ) ! = null ) { for ( map entry < object , object > property : queue get properties ( ) entry set ( ) ) { dump generator write start object ( ) ; dump generator write string field ( " key " , ( string ) property get key ( ) ) ; dump generator write string field ( " value " , ( string ) property get value ( ) ) ; dump generator write end object ( ) ; } } dump generator write end array ( ) ; set < queue > child queues = queue get children ( ) ; dump generator write field name ( " children " ) ; dump generator write start array ( ) ; if ( child queues ! = null & & child queues size ( ) > 0 ) { dump configuration ( dump generator , child queues ) ; } dump generator write end array ( ) ; dump generator write end object ( ) ; } }


returns the prototypes of the attributes used by this class , its fields and its methods


return an array of queue information objects about all the job queues configured

public job queue info [ ] get queues ( ) throws i o exception { try { return client ugi do as ( new privileged exception action < job queue info [ ] > ( ) { public job queue info [ ] run ( ) throws i o exception , interrupted exception { return get job queue info array ( cluster get queues ( ) ) ; } } ) ; } catch ( interrupted exception ie ) { throw new i o exception ( ie ) ; } }


public int get simple int ( ) { return simple int ; }


patch a configuration with the secrets this does not set any per - bucket options ( it doesn ' t know the bucket ) warning : once done the configuration must be considered sensitive

public void set secrets in configuration ( configuration config ) { config set ( access key , access key ) ; config set ( secret key , secret key ) ; s 3 a utils set if defined ( config , session token , session token , " session credentials " ) ; }


resolve this type by a single level , returning the resolved value or { @ link # none } note : the returned { @ link resolvable type } should only be used as an intermediary as it cannot be serialized

resolvable type resolve type ( ) { if ( this type instanceof parameterized type ) { return for type ( ( ( parameterized type ) this type ) get raw type ( ) , this variable resolver ) ; } if ( this type instanceof wildcard type ) { type resolved = resolve bounds ( ( ( wildcard type ) this type ) get upper bounds ( ) ) ; if ( resolved = = null ) { resolved = resolve bounds ( ( ( wildcard type ) this type ) get lower bounds ( ) ) ; } return for type ( resolved , this variable resolver ) ; } if ( this type instanceof type variable ) { type variable < ? > variable = ( type variable < ? > ) this type ; / / try default variable resolution if ( this variable resolver ! = null ) { resolvable type resolved = this variable resolver resolve variable ( variable ) ; if ( resolved ! = null ) { return resolved ; } } / / fallback to bounds return for type ( resolve bounds ( variable get bounds ( ) ) , this variable resolver ) ; } return none ; }


public static http response execute ( final string url , final string method , final string basic auth username , final string basic auth password ) { return execute ( url , method , basic auth username , basic auth password , new hash map < > ( 0 ) , new hash map < > ( 0 ) ) ; }


searches previous application settings directories ( { @ link # get user settings dirs by time ( ) } ) to find a file by the given name this is useful for loading previous user settings , such as preferences note : this method will ignore any test versions of settings directories

public static file get previous application settings file ( string filename ) { list < file > settings dirs = get previous application settings dirs by time ( ) ; for ( file dir : settings dirs ) { string dir path = dir get path ( ) ; if ( dir path ends with ( " test " ) ) { continue ; / / ignore any test directories } string alt file path = dir path + file separator char + filename ; file file = new file ( alt file path ) ; if ( ! file exists ( ) ) { continue ; } return file ; } return null ; }


public path path ( ) { return file path ; }


attempts to execute all the listeners in { @ link # listeners }

void dispatch listener events ( ) { check state ( ! monitor is occupied by current thread ( ) , " it is incorrect to execute listeners with the monitor held " ) ; listeners dispatch ( ) ; }


returns the items as an array note the array is typed , so the { @ link # array ( class ) } constructor must have been used otherwise use { @ link # to array ( class ) } to specify the array type

public t [ ] to array ( ) { return ( t [ ] ) to array ( items get class ( ) get component type ( ) ) ; }


returns a sum of euclidean distances between points in the linestring

public double length ( line line ) { double distance = 0 ; double [ ] prev = new double [ ] { line get lon ( 0 ) , line get lat ( 0 ) } ; geo utils normalize point ( prev , false , true ) ; for ( int i = 1 ; i < line length ( ) ; i + + ) { double [ ] cur = new double [ ] { line get lon ( i ) , line get lat ( i ) } ; geo utils normalize point ( cur , false , true ) ; distance + = math sqrt ( ( cur [ 0 ] - prev [ 0 ] ) * ( cur [ 0 ] - prev [ 0 ] ) + ( cur [ 1 ] - prev [ 1 ] ) * ( cur [ 1 ] - prev [ 1 ] ) ) ; prev = cur ; } return distance ; }


convert from the universal java util date format to the type - specific format

object to type ( config config , date orig ) ;


override equals check to use primary key ( s ) for comparison

public boolean equals ( object obj ) { if ( ! ( obj instanceof base record ) ) { return false ; } base record base object = ( base record ) obj ; map < string , string > keyset 1 = this get primary keys ( ) ; map < string , string > keyset 2 = base object get primary keys ( ) ; return keyset 1 equals ( keyset 2 ) ; }


returns the transitive compilation prerequisites consolidated into middlemen prerequisites , or an empty set if there are no prerequisites transitive compilation prerequisites are the prerequisites that will be needed by all reverse dependencies ; note that these do specifically not include any compilation prerequisites that are only needed by the rule itself ( for example , compiled source files from the { @ code srcs } attribute ) to reduce the number of edges in the action graph , we express the dependency on compilation prerequisites as a transitive dependency via a middleman after they have been accumulated ( { @ link builder # merge dependent cc compilation context ( cc compilation context ) } , and { @ link builder # merge dependent cc compilation contexts ( iterable ) } , they are consolidated into a single middleman artifact when { @ link builder # build ( ) } is called the returned set can be empty if there are no prerequisites usually , it contains a single middleman

public nested set < artifact > get transitive compilation prerequisites ( ) { return compilation prerequisites ; }


public long get count ( ) { return 0l ; }


validate a test where each result has the same values

private static < t > void validate ( graph < t , null value , null value > graph , long count , double score ) throws exception { data set < result < t > > pr = new page rank < t , null value , null value > ( damping factor , accuracy ) set include zero degree vertices ( true ) run ( graph ) ; list < result < t > > results = pr collect ( ) ; assert equals ( count , results size ( ) ) ; for ( result < t > result : results ) { assert equals ( score , result get page rank score ( ) get value ( ) , accuracy ) ; } }


return whether to always create a new collection , even if the type of the passed - in collection already matches default is " false " ; can be overridden to enforce creation of a new collection , for example to convert elements in any case

protected boolean always create new collection ( ) { return false ; }


clears the analysis cache as in - - discard analysis cache

void clear analysis cache ( collection < configured target > top level targets , immutable set < aspect key > top level aspects ) { skyframe build view clear analysis cache ( top level targets , top level aspects ) ; }


check if identity is allowed to create the specified view in a catalog

default void check can create view ( identity identity , access control context context , catalog schema table name view ) { deny create view ( view to string ( ) ) ; }


tests that a client and a server configured using grpc ssl contexts can successfully communicate with each other

public void basic client server integration test ( ) throws exception { / / create & start a server file server cert file = test utils load cert ( " server 1 pem " ) ; file server private key file = test utils load cert ( " server 1 key " ) ; x 5 0 9 certificate [ ] server trusted ca certs = { test utils load x 5 0 9 cert ( " ca pem " ) } ; server = server builder ( 0 , server cert file , server private key file , server trusted ca certs ) add service ( new simple service impl ( ) ) build ( ) start ( ) ; / / create a client file client cert chain file = test utils load cert ( " client pem " ) ; file client private key file = test utils load cert ( " client key " ) ; x 5 0 9 certificate [ ] client trusted ca certs = { test utils load x 5 0 9 cert ( " ca pem " ) } ; channel = client channel ( server get port ( ) , client context builder key manager ( client cert chain file , client private key file ) trust manager ( client trusted ca certs ) build ( ) ) ; simple service grpc simple service blocking stub client = simple service grpc new blocking stub ( channel ) ; / / send an actual request , via the full grpc & network stack , and check that a proper / / response comes back client unary rpc ( simple request get default instance ( ) ) ; }


finds pets by tags multiple tags can be provided with comma separated strings use tag 1 , tag 2 , tag 3 for testing

public void find pets by tags test ( ) throws exception { list < string > tags = null ; response entity < list < pet > > response = api find pets by tags ( tags , accept ) ; / / todo : test validations }


returns true if the give file is not null , exists , is a directory and contains files

public static boolean directory exists and is not empty ( file directory ) { if ( directory = = null ) { return false ; } if ( ! directory exists ( ) ) { return false ; } if ( ! directory is directory ( ) ) { return false ; } return ! directory is empty ( directory ) ; }


get topics ( max 10 ) for our project id : the topic list is logged to the logger

public void get topics ( string project i d ) { logger log ( level info , " will try to get topics for project { 0 } " , project i d ) ; list topics request request = list topics request new builder ( ) set page size ( 10 ) / / get max 10 topics set project ( project i d ) / / for our project i d build ( ) ; list topics response response ; try { response = blocking stub list topics ( request ) ; } catch ( status runtime exception e ) { logger log ( level warning , " rpc failed : { 0 } " , e get status ( ) ) ; return ; } logger log ( level info , " topics list : \ n { 0 } " , response get topics list ( ) ) ; }


the series of types defined by the package < code > repeated aapt pb type type = 3 ; < code >


return true if file was under construction when this located blocks was constructed , false otherwise

public boolean is under construction ( ) { return under construction ; }


public static void configure stub ( maven project stub configure , string test name , string pom file name ) { maven xpp 3 reader pom reader = new maven xpp 3 reader ( ) ; model model = null ; try { file pom file = based path ( configure get basedir ( ) , " src " , " test " , " resources " , " unit " , test name , pom file name ) to file ( ) ; model = pom reader read ( new input stream reader ( new file input stream ( pom file ) , standard charsets utf 8 ) ) ; configure set model ( model ) ; } catch ( exception ignored ) { } configure set group id ( model get group id ( ) ) ; configure set artifact id ( model get artifact id ( ) ) ; configure set version ( model get version ( ) ) ; configure set name ( model get name ( ) ) ; configure set url ( model get url ( ) ) ; configure set packaging ( model get packaging ( ) ) ; build build = new build ( ) ; build set final name ( model get build ( ) get final name ( ) ) ; build set directory ( based path ( configure get basedir ( ) , " target " , " test " , " unit " , test name , " target " ) to string ( ) ) ; build set source directory ( based path ( configure get basedir ( ) , " src " , " test " , " resources " , " unit " , test name ) to string ( ) ) ; configure set build ( build ) ; list < string > compile source roots = new array list < > ( ) ; compile source roots add ( based path ( configure get basedir ( ) , " src " , " test " , " resources " , " unit " , test name , " src " ) to string ( ) ) ; configure set compile source roots ( compile source roots ) ; artifact stub artifact stub = new artifact stub ( ) ; artifact stub set group id ( configure get group id ( ) ) ; artifact stub set artifact id ( configure get artifact id ( ) ) ; artifact stub set version ( configure get version ( ) ) ; artifact stub set artifact handler ( new default artifact handler stub ( " jar " ) ) ; configure set artifact ( artifact stub ) ; configure set file ( configure get basedir ( ) to path ( ) resolve ( pom file name ) to file ( ) ) ; }


lookup the context for an already resolved field type

public final field context build field context ( mapped field type ft ) { return new field context ( ft name ( ) , build field data ( ft ) , ft ) ; }


returns just the shell command to be used to fetch a user ' s groups list this is mainly separate to make some tests easier

protected string [ ] get groups for user command ( string user name ) { return shell get groups for user command ( user name ) ; }


public static int get measured height ( final view view ) { return measure view ( view ) [ 1 ] ; }


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

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


return whether this container is currently active , that is , whether it has been set up but not shut down yet

public final boolean is active ( ) { synchronized ( this lifecycle monitor ) { return this active ; } }


public final void start ( client stream listener listener ) { master listener = listener ; status shutdown status = prestart ( ) ; if ( shutdown status ! = null ) { cancel ( shutdown status ) ; return ; } class start entry implements buffer entry { @ override public void run with ( substream substream ) { substream stream start ( new sublistener ( substream ) ) ; } } synchronized ( lock ) { state buffer add ( new start entry ( ) ) ; } substream substream = create substream ( 0 ) ; if ( is hedging ) { future canceller scheduled hedging ref = null ; synchronized ( lock ) { state = state add active hedge ( substream ) ; if ( has potential hedging ( state ) & & ( throttle = = null | | throttle is above threshold ( ) ) ) { scheduled hedging = scheduled hedging ref = new future canceller ( lock ) ; } } if ( scheduled hedging ref ! = null ) { scheduled hedging ref set future ( scheduled executor service schedule ( new hedging runnable ( scheduled hedging ref ) , hedging policy hedging delay nanos , time unit nanoseconds ) ) ; } } drain ( substream ) ; }


sets the size of the fragment to return from the beginning of the field if there are no matches to highlight and the field doesn ' t also define no match size

public hb no match size ( integer no match size ) { this no match size = no match size ; return ( hb ) this ; }


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


sends an rpc to an unimplemented service on the server

public void unimplemented service ( ) { unimplemented service grpc unimplemented service blocking stub stub = unimplemented service grpc new blocking stub ( channel ) with interceptors ( tracer setup interceptor ) ; try { stub unimplemented call ( empty get default instance ( ) ) ; fail ( ) ; } catch ( status runtime exception e ) { assert equals ( status unimplemented get code ( ) , e get status ( ) get code ( ) ) ; } assert stats trace ( " grpc testing unimplemented service / unimplemented call " , status code unimplemented ) ; }


execute a query given static sql , mapping each row to a result object via a row mapper , and turning it into an iterable and closeable stream uses a jdbc statement , not a prepared statement if you want to execute a static query with a prepared statement , use the overloaded { @ code query } method with { @ code null } as argument array

< t > stream < t > query for stream ( string sql , row mapper < t > row mapper ) throws data access exception ;


this test validates the correctness of get application report in case of empty request

public void test get application empty request ( ) throws yarn exception , i o exception , interrupted exception { log info ( " test federation client interceptor : get application report - empty " ) ; try { interceptor get application report ( null ) ; assert fail ( ) ; } catch ( yarn exception e ) { assert assert true ( e get message ( ) starts with ( " missing get application report request or " + " application id information " ) ) ; } try { interceptor get application report ( get application report request new instance ( null ) ) ; assert fail ( ) ; } catch ( yarn exception e ) { assert assert true ( e get message ( ) starts with ( " missing get application report request or " + " application id information " ) ) ; } }


public void attribute boolean test ( ) { / / todo : test attribute boolean }


create config strings that will be used for the test servers

private array list < string > build server strings ( ) { array list < string > server strings = new array list < string > ( ) ; for ( int i = 0 ; i < num servers ; i + + ) { client ports [ i ] = port assignment unique ( ) ; string server = " server " + i + " = localhost : " + port assignment unique ( ) + " : " + port assignment unique ( ) + " : participant ; " + " localhost : " + client ports [ i ] ; server strings add ( server ) ; } return server strings ; }


< code > required uint 3 2 second = 8 ; < code >


encode to a geohash string from full resolution longitude , latitude )

public static final string string encode ( final double lon , final double lat ) { return string encode ( lon , lat , 12 ) ; }


return and access condition for this lease , or else null if there ' s no lease

private access condition get lease condition ( self renewing lease lease ) { access condition lease condition = null ; if ( lease ! = null ) { lease condition = access condition generate lease condition ( lease get lease i d ( ) ) ; } return lease condition ; }


update the item at index position the { @ link recycler view } will only be notified of the item being updated after a layout calculation has been completed for the new { @ link component }

public final void update item at async ( int position , render info render info ) { assert single thread for change set ( ) ; if ( sections debug enabled ) { log d ( sections debug tag , " ( " + hash code ( ) + " ) update item at async " + position ) ; } / / todo ( t 3 4 1 5 4 9 2 1 ) : experiment with applying new render info for updates immediately when in / / immediate mode synchronized ( this ) { add to current batch ( new async update operation ( position , render info ) ) ; } }


test balancer runs fine when logging in with a keytab in kerberized env reusing test unknown datanode here for basic functionality testing

public void test balancer with keytabs ( ) throws exception { final configuration conf = new hdfs configuration ( ) ; try { init secure conf ( conf ) ; final user group information ugi = user group information login user from keytab and return u g i ( principal , keytab file get absolute path ( ) ) ; ugi do as ( new privileged exception action < void > ( ) { @ override public void run ( ) throws exception { / / verify that balancer runs ok test unknown datanode ( conf ) ; / / verify that ugi was logged in using keytab assert true ( user group information is login keytab based ( ) ) ; return null ; } } ) ; } finally { / / reset ugi so that other tests are not affected user group information reset ( ) ; user group information set configuration ( new configuration ( ) ) ; } }


get the actual instance of ` danish pig ` if the actual instanct is not ` danish pig ` , the class cast exception will be thrown

public danish pig get danish pig ( ) throws class cast exception { return ( danish pig ) super get actual instance ( ) ; }


public builder set blur ( float radius , blur style ) { this radius = radius ; this style = style ; this is blur = true ; return this ; }


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

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


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { default : return null ; } }


retrieve the secure settings in these settings

secure settings get secure settings ( ) { / / pkg private so it can only be accessed by local subclasses of secure setting return secure settings ; }


returns the total number of uncompressed bytes output so far

public synchronized long get bytes written ( ) { check stream ( ) ; return get bytes written ( stream ) ; }


set a pipeline drawee controller factory to be used instead of the default one

public builder set pipeline drawee controller factory ( pipeline drawee controller factory factory ) { m pipeline drawee controller factory = factory ; return this ; }


create a readable and parseable audit log string for a successful event

public static void log success ( string user , string operation , string target , application id app id , container id container id ) { if ( log is info enabled ( ) ) { log info ( create success log ( user , operation , target , app id , container id ) ) ; } }


public busy box action builder add input ( artifact value ) { preconditions check not null ( value ) ; command line add exec path ( value ) ; inputs add ( value ) ; return this ; }


creates a new listenable future - style stub that supports unary calls on the service

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


validates that milliseconds from { @ code instant } can be retrieved

public static long validate millisecond instant ( final instant instant , final string message prefix ) { try { if ( instant = = null ) { throw new illegal argument exception ( message prefix + validate millisecond null suffix ) ; } return instant to epoch milli ( ) ; } catch ( final arithmetic exception e ) { throw new illegal argument exception ( message prefix + validate millisecond overflow suffix , e ) ; } }


developer tester is able to choose whether the application should use mongo d b as its underlying data storage or a simple java data structure to ( temporarily ) store the dataobjects during runtime

public static void init db ( boolean use mongo db ) { if ( use mongo db ) { try { db manager connect ( ) ; } catch ( parse exception e ) { e print stack trace ( ) ; } } else { db manager create virtual db ( ) ; } }


public int get line number ( ) { return line number ; }


removes and returns the greatest element of this queue

public e remove last ( ) { if ( is empty ( ) ) { throw new no such element exception ( ) ; } return remove and get ( get max element index ( ) ) ; }


attaches the tool tip from the gui resources that corresponds to the given key , to the given component

private static j component tip ( j component component , string message key ) { component set tool tip text ( msg ( message key ) ) ; return component ; }


return the enum that corresponds to the connect protocol version that is given as an argument ; if no mapping is found { @ code illegal argument exception } is thrown

public static connect protocol compatibility from protocol version ( short protocol version ) { switch ( protocol version ) { case connect protocol v0 : return eager ; case connect protocol v1 : return compatible ; case connect protocol v2 : return sessioned ; default : throw new illegal argument exception ( " unknown connect protocol version : " + protocol version ) ; } }


public string get help id ( ) { return id ; }


will always keep this guy alive so that it can function as a fallback to execute { @ link flyweight task } s see jenkins - 7291

protected boolean is alive ( ) { return true ; }


return number of index record entries in this spill

public int size ( ) { return entries capacity ( ) / ( map task map output index record length / 8 ) ; }


creates an authentication statement for the current request

private authn statement build authn statement ( final object cas assertion , final request abstract type authn request , final saml registered service service provider metadata facade adaptor , final saml registered service service , final string binding , final http servlet request request ) throws saml exception { val assertion = assertion class cast ( cas assertion ) ; val authentication method = this authn context class ref builder build ( assertion , authn request , adaptor , service ) ; var id = request ! = null ? common utils safe get parameter ( request , cas protocol constants parameter ticket ) : string utils empty ; if ( string utils is blank ( id ) ) { logger warn ( " unable to locate service ticket as the session index ; generating random identifier instead " ) ; id = ' ' + string value of ( random utils next long ( ) ) ; } val statement = new authn statement ( authentication method , date time utils zoned date time of ( assertion get authentication date ( ) ) , id ) ; if ( assertion get valid until date ( ) ! = null ) { val dt = date time utils zoned date time of ( assertion get valid until date ( ) ) ; val skew allowance = service get skew allowance ( ) > 0 ? service get skew allowance ( ) : cas properties get authn ( ) get saml idp ( ) get response ( ) get skew allowance ( ) ; statement set session not on or after ( dt plus seconds ( skew allowance ) to instant ( ) ) ; } val subject locality = build subject locality ( assertion , authn request , adaptor , binding ) ; statement set subject locality ( subject locality ) ; return statement ; }


continue execution from the current execution address no adjustment will be made to the context beyond the normal context flow behavior defined by the language method will block until execution stops

public synchronized boolean run ( task monitor monitor ) throws cancelled exception { if ( emulator is executing ( ) ) { throw new illegal state exception ( " emulator is already running " ) ; } continue execution ( monitor ) ; return emulator is at breakpoint ( ) ; }


schedules a task to occur once after the specified delay and then a number of additional times at the specified interval

public task schedule task ( task task , float delay seconds , float interval seconds , int repeat count ) { synchronized ( thread lock ) { synchronized ( this ) { synchronized ( task ) { if ( task timer ! = null ) throw new illegal argument exception ( " the same task may not be scheduled twice " ) ; task timer = this ; long time millis = system nano time ( ) / 1000000 ; long execute time millis = time millis + ( long ) ( delay seconds * 1000 ) ; if ( thread pause time millis > 0 ) execute time millis - = time millis - thread pause time millis ; task execute time millis = execute time millis ; task interval millis = ( long ) ( interval seconds * 1000 ) ; task repeat count = repeat count ; tasks add ( task ) ; } } thread lock notify all ( ) ; } return task ; }


displays tag differences if they exist between the two functions

private void add tag details ( styled document doc 1 , styled document doc 2 ) { function func 1 = l 1 get function at ( current p 1 address ) ; function func 2 = ( current p 2 address ! = null ) ? l 2 get function at ( current p 2 address ) : null ; if ( func 1 = = null | | func 2 = = null ) { msg error ( this , " couldn ' t find functions for addresses : " + current p 1 address + " : : " + current p 2 address ) ; } set < function tag > func 1 tags = func 1 get tags ( ) ; set < function tag > func 2 tags = func 2 get tags ( ) ; / / sort the tags before we print out the details - this will make viewing / / the differences much easier func 1 tags = new tree set < > ( func 1 tags ) ; func 2 tags = new tree set < > ( func 2 tags ) ; if ( ! program diff equivalent tag sets ( func 1 tags , func 2 tags ) ) { add text ( doc 1 , indent 2 + " tags : " ) ; add color text ( doc 1 , get tag info ( func 1 tags ) ) ; add text ( doc 1 , new line ) ; add text ( doc 2 , indent 2 + " tags : " ) ; add color text ( doc 2 , get tag info ( func 2 tags ) ) ; add text ( doc 2 , new line ) ; has tag diffs = true ; } has tag diffs = false ; }


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


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


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


sets optional minimum should match value to apply to the query

public match query builder minimum should match ( string minimum should match ) { this minimum should match = minimum should match ; return this ; }


setup and return the underlying { @ link file system } mock

static file system setup ( ) throws i o exception { if ( mock fs = = null ) { mock fs = mock ( file system class ) ; } reset ( mock fs ) ; configuration conf = new configuration ( ) ; conf set ( " fs default f s " , " mockfs : / / / " ) ; conf set class ( " fs mockfs impl " , mock file system class , file system class ) ; when ( mock fs get conf ( ) ) then return ( conf ) ; return mock fs ; }


specify the level of caching that this listener container is allowed to apply default is { @ link # cache none } if an external transaction manager has been specified ( to reobtain all resources freshly within the scope of the external transaction ) , and { @ link # cache consumer } otherwise ( operating with local jms resources ) some java ee servers only register their jms resources with an ongoing xa transaction in case of a freshly obtained jms { @ code connection } and { @ code session } , which is why this listener container by default does not cache any of those however , depending on the rules of your server with respect to the caching of transactional resources , consider switching this setting to at least { @ link # cache connection } or { @ link # cache session } even in conjunction with an external transaction manager

public void set cache level ( int cache level ) { this cache level = cache level ; }


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


returns the section where the relocations will be applied for example , this method will return " plt " for " rel plt "

public elf section header get section to be relocated ( ) { return section to be relocated ; }


returns the offset of the virtual function table pointer

int get offset ( ) { if ( ms type instanceof abstract virtual function table pointer with offset ms type ) { return ( ( abstract virtual function table pointer with offset ms type ) ms type ) get offset ( ) ; } return 0 ; }


allow the activity context to be injected but require that it be annotated with { @ link for activity @ for activity } to explicitly differentiate it from application context

@ provides @ singleton @ for activity context provide activity context ( ) { return activity ; }


test access when file does not exist and permissions match

public void test access file does not exist ( ) throws throwable { expected ex expect ( file not found exception class ) ; configuration conf = fs get conf ( ) ; fs set conf ( conf ) ; final path test path = new path ( " / test access file does not exist " ) ; authorizer init ( conf ) ; authorizer add auth rule for owner ( test path to string ( ) , read , true ) ; authorizer add auth rule for owner ( test path to string ( ) , write , true ) ; fs update wasb authorizer ( authorizer ) ; assert path does not exist ( fs , " test path exists " , test path ) ; fs access ( test path , fs action all ) ; }


public headers headers ( ) { return headers ; }


obtain the transactional entity manager for this accessor ' s entity manager factory , if any

protected entity manager get transactional entity manager ( ) throws illegal state exception { entity manager factory emf = obtain entity manager factory ( ) ; return entity manager factory utils get transactional entity manager ( emf , get jpa property map ( ) ) ; }


checks if two instructions are a pair a pair is found if 1 ) mnemonics are correct 2 ) offset difference is correct 3 ) destination and base registers match

private instruction check pair ( scalar offset 1 , scalar offset 2 , register base 1 , register base 2 , register dest reg 1 , register dest reg 2 , instruction start inst , instruction curr inst ) { int start index 1 = 0 ; int start index 2 = 0 ; string str = start inst get mnemonic string ( ) ; string str 2 = curr inst get mnemonic string ( ) ; / / check for delay slot if ( str char at ( 0 ) = = ' ' ) { start index 1 = 1 ; } if ( str 2 char at ( 0 ) = = ' ' ) { start index 2 = 1 ; } / / check mnemonics are matching if ( ! str substring ( start index 1 , start index 1 + 2 ) equals ( str 2 substring ( start index 2 , start index 2 + 2 ) ) ) { return null ; } / / check offset long diff = math abs ( offset 2 get signed value ( ) - offset 1 get signed value ( ) ) ; if ( ( str ends with ( " wl " ) | | str ends with ( " wr " ) ) & & diff ! = 3 ) { return null ; } else if ( ( str ends with ( " dl " ) | | str ends with ( " dr " ) ) & & diff ! = 7 ) { return null ; } / / check base and destination registers if ( base 1 equals ( base 2 ) & & ( dest reg 1 equals ( dest reg 2 ) | dest reg 2 equals ( alternate reg ) ) ) { / / match found return curr inst ; } return null ; }


public void test constructor 2 ( ) { atomic double a = new atomic double ( ) ; assert bit equals ( 0 0 , a get ( ) ) ; }


creates the { @ link listenable future } which will return the result of calling { @ link async callable # call } in { @ code combiner } when all futures complete , using the specified { @ code executor } if the combiner throws a { @ code cancellation exception } , the returned future will be cancelled if the combiner throws an { @ code execution exception } , the cause of the thrown { @ code execution exception } will be extracted and returned as the cause of the new { @ code execution exception } that gets thrown by the returned combined future canceling this future will attempt to cancel all the component futures

public < c > listenable future < c > call async ( async callable < c > combiner , executor executor ) { return new combined future < c > ( futures , all must succeed , executor , combiner ) ; }


public int create ( final e element ) { final int c = search ( created , element get key ( ) ) ; add created ( element , c ) ; return c ; }


public collection < ? extends one time token account > get ( @ selector final string username ) { return repository get ( username ) ; }


updates the current alphas based on the ratio of the elapsed time and duration

private boolean update alphas ( float ratio ) { boolean done = true ; for ( int i = 0 ; i < m layers length ; i + + ) { int dir = m is layer on [ i ] ? + 1 : - 1 ; / / determines alpha value and clamps it to [ 0 , 255 ] m alphas [ i ] = ( int ) ( m start alphas [ i ] + dir * 255 * ratio ) ; if ( m alphas [ i ] < 0 ) { m alphas [ i ] = 0 ; } if ( m alphas [ i ] > 255 ) { m alphas [ i ] = 255 ; } / / determines whether the layer has reached its target opacity if ( m is layer on [ i ] & & m alphas [ i ] < 255 ) { done = false ; } if ( ! m is layer on [ i ] & & m alphas [ i ] > 0 ) { done = false ; } } return done ; }


{ @ inherit doc } a { @ link run action 2 } is handled specially

public void add action ( @ non null action a ) { super add action ( a ) ; if ( a instanceof run action 2 ) { ( ( run action 2 ) a ) on attached ( this ) ; } else if ( a instanceof run action ) { ( ( run action ) a ) on attached ( this ) ; } }


asynchronous version of { @ link abstract dao # insert or replace ( object ) }

public async operation insert or replace ( object entity ) { return insert or replace ( entity , 0 ) ; }


get a comparator for a { @ link writable comparable } implementation

public static writable comparator get ( class < ? extends writable comparable > c , configuration conf ) { writable comparator comparator = comparators get ( c ) ; if ( comparator = = null ) { / / force the static initializers to run force init ( c ) ; / / look to see if it is defined now comparator = comparators get ( c ) ; / / if not , use the generic one if ( comparator = = null ) { comparator = new writable comparator ( c , conf , true ) ; } } / / newly passed configuration objects should be used reflection utils set conf ( comparator , conf ) ; return comparator ; }


{ @ link r m app attempt state # launched }

private void test app attempt recovered state ( ) { assert equals ( r m app attempt state launched , application attempt get app attempt state ( ) ) ; }


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


< code > optional int 6 4 num = 4 ; < code >


protected void normalize resource requests ( list < resource request > asks ) { normalize resource requests ( asks , null ) ; }


returns true if this data set is visible inside the chart , or false if it is currently hidden


a { @ link queryable store type } that accepts { @ link read only window store }

public static < k , v > queryable store type < read only window store < k , v > > window store ( ) { return new window store type < > ( ) ; }


returns the minimum grand child or - 1 if no grand child exists

int find min grand child ( int index ) { int left child index = get left child index ( index ) ; if ( left child index < 0 ) { return - 1 ; } return find min ( get left child index ( left child index ) , 4 ) ; }


makes sure { @ link # children } is writable

private void make writable ( ) { if ( children = = no children ) { children = new hash map < string , child > ( ) ; } }


returns the result of subtracting this and { @ code val } if the result would be negative , returns the low 32 bits of the result

public unsigned integer minus ( unsigned integer val ) { return from int bits ( value - check not null ( val ) value ) ; }


return the { @ link annotation metadata } of the importing { @ link configuration } class

public annotation metadata get metadata ( ) { return this metadata ; }


returns a factory for creating fully resolved data types that can be used for planning

public data type factory get data type factory ( ) { return type factory ; }


returns an immutable array containing the given values , in order

public static immutable double array of ( double e 0 , double e 1 , double e 2 , double e 3 ) { return new immutable double array ( new double [ ] { e 0 , e 1 , e 2 , e 3 } ) ; }


marshal the given object to a { @ link text message }

protected text message marshal to text message ( object object , session session , marshaller marshaller ) throws j m s exception , i o exception , xml mapping exception { string writer writer = new string writer ( 1024 ) ; result result = new stream result ( writer ) ; marshaller marshal ( object , result ) ; return session create text message ( writer to string ( ) ) ; }


determine the ' { @ code id } ' attribute value for this tag , autogenerating one if none specified

protected string resolve id ( ) throws jsp exception { object id = evaluate ( " id " , get id ( ) ) ; if ( id ! = null ) { string id string = id to string ( ) ; return ( string utils has text ( id string ) ? id string : null ) ; } return autogenerate id ( ) ; }


public void perform ( ) { move to location ( ) ; mouse double click ( get action location ( ) ) ; }


update application ' s blacklist with addition or removal resources

public abstract void update blacklist ( list < string > blacklist additions , list < string > blacklist removals ) ;


set the timeout in milliseconds for this operation or { @ code null } if the default api timeout for the admin client should be used

public delete topics options timeout ms ( integer timeout ms ) { this timeout ms = timeout ms ; return this ; }


sets the content of the output buffer , consisting of a { @ link subtitle } and associated metadata

public void set content ( long time us , subtitle subtitle , long subsample offset us ) { this time us = time us ; this subtitle = subtitle ; this subsample offset us = subsample offset us = = format offset sample relative ? this time us : subsample offset us ; }


close the current stream being used by the pojo

public void close ( ) { if ( stream ! = null ) { try { stream close ( ) ; } catch ( i o exception e ) { e print stack trace ( ) ; } reset ( null , false ) ; } }


set whether the output of the job is compressed

public static void set compress output ( job job , boolean compress ) { job get configuration ( ) set boolean ( file output format compress , compress ) ; }


append specified length of bytes to a given file , starting with new block

public static void append file new block ( distributed file system fs , path p , int length ) throws i o exception { assert length > = 0 ; byte [ ] to append = new byte [ length ] ; random random = new random ( ) ; random next bytes ( to append ) ; append file new block ( fs , p , to append ) ; }


returns the transient { @ link action } s associated with the top page adding { @ link action } is primarily useful for plugins to contribute an item to the navigation bar of the top page see existing { @ link action } implementation for it affects the gui to register an { @ link action } , implement { @ link root action } extension point , or write code like { @ code jenkins get ( ) get actions ( ) add ( ) }

public list < action > get actions ( ) { return actions ; }


clear all cached precomputed values if you are modifying something that requires this to be called , you probably also need to call { @ link com google refine lookup cache manager # flush lookups involving project column ( long , string ) } e g project manager singleton get lookup cache manager ( ) flush lookups involving project column ( project id , column get name ( ) )

public void clear precomputes ( ) { if ( precomputes ! = null ) { precomputes clear ( ) ; } }


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


public parameter get parameter ( ) { return parameter ; }


set the date and time at which the message is no longer valid , as specified by the { @ code expires } header

public void set expires ( instant expires ) { set instant ( expires , expires ) ; }


returns the key set id of the offline license

public byte [ ] get key set id ( ) { return key set id ! = null ? arrays copy of ( key set id , key set id length ) : null ; }


public void reload ( ) { / / do nothing by default ; override in subs if necessary }


creates stream descriptor which is a copy of this one with the value of sequence changed to the value passed in recursively calls itself on the nested streams

private static stream descriptor copy stream descriptor with sequence ( stream descriptor stream descriptor , int sequence ) { list < stream descriptor > stream descriptors = stream descriptor get nested streams ( ) stream ( ) map ( stream - > copy stream descriptor with sequence ( stream , sequence ) ) collect ( to immutable list ( ) ) ; return new stream descriptor ( stream descriptor get stream name ( ) , stream descriptor get stream id ( ) , stream descriptor get field name ( ) , stream descriptor get orc type ( ) , stream descriptor get orc data source ( ) , stream descriptors , sequence ) ; }


private void wipe cluster settings ( ) throws i o exception { map < ? , ? > get response = entity as map ( admin client ( ) perform request ( new request ( " get " , " / cluster / settings " ) ) ) ; boolean must clear = false ; x content builder clear command = json x content content builder ( ) ; clear command start object ( ) ; for ( map entry < ? , ? > entry : get response entry set ( ) ) { string type = entry get key ( ) to string ( ) ; map < ? , ? > settings = ( map < ? , ? > ) entry get value ( ) ; if ( settings is empty ( ) ) { continue ; } must clear = true ; clear command start object ( type ) ; for ( object key : settings key set ( ) ) { clear command field ( key + " * " ) null value ( ) ; } clear command end object ( ) ; } clear command end object ( ) ; if ( must clear ) { request request = new request ( " put " , " / cluster / settings " ) ; request set json entity ( strings to string ( clear command ) ) ; admin client ( ) perform request ( request ) ; } }


limits a ( possibly sorted ) result to the first n rows this method can be combined with a preceding { @ link # order by ( expression ) } call for a deterministic order and { @ link # offset ( int ) } call to return n rows after skipping the first o rows { @ code returns the first 3 records tab order by ( $ ( " name " ) desc ( ) ) fetch ( 3 ) ; skips the first 10 rows and returns the next 5 rows tab order by ( $ ( " name " ) desc ( ) ) offset ( 10 ) fetch ( 5 ) ; }


public static void set rules ( string rule string ) { rules = ( rule string ! = null ) ? parse rules ( rule string ) : null ; }


update query and header parameters based on authentication settings

private void update params for auth ( string [ ] auth names , list < pair > query params , map < string , string > header params , map < string , string > cookie params ) { for ( string auth name : auth names ) { authentication auth = authentications get ( auth name ) ; if ( auth = = null ) throw new runtime exception ( " authentication undefined : " + auth name ) ; auth apply to params ( query params , header params , cookie params ) ; } }


this sets up a unique path for every test run , so as to guarantee isolation from previous runs it creates a role policy which has read access to everything except the contents of { @ link # no read dir } , and with write access to { @ link # writable dir }

public void setup ( ) throws exception { super setup ( ) ; assume role tests ( ) ; base path = unique path ( ) ; read only dir = new path ( base path , " readonly dir " ) ; writable dir = new path ( base path , " writable dir " ) ; read only child = new path ( read only dir , " child " ) ; no read dir = new path ( base path , " no read dir " ) ; / / the full fs s 3 a file system fs = get file system ( ) ; fs delete ( base path , true ) ; fs mkdirs ( writable dir ) ; / / create the baseline assumed role assumed role config = create assumed role config ( ) ; bind role policy statements ( assumed role config , statement s3guard client , statement allow sse kms rw , statement all bucket read access , / / root : r - x new statement ( effects allow ) / / dest : rwx add actions ( s3 path rw operations ) add resources ( directory ( writable dir ) ) , new statement ( effects deny ) / / no read dir : - - x add actions ( s3 all get ) add actions ( s3 all put ) add actions ( s3 all delete ) add resources ( directory ( no read dir ) ) ) ; / / the role configured to that set of restrictions role f s = ( s 3 a file system ) read only dir get file system ( assumed role config ) ; / / switch to the big set of files iff this is a multidelete run / / with - dscale set / / without that the delete calls become a key part of the bottleneck scale test = multi delete & & get test property bool ( get configuration ( ) , key scale tests enabled , default scale tests enabled ) ; file count = scale test ? file count scaled : file count non scaled ; dir count = scale test ? dir count scaled : dir count ; dir depth = scale test ? depth scaled : depth ; }


converts a integral value to the corresponding little endian array

private static byte [ ] integer to little endian ( byte [ ] buf , int offset , long value , int num bytes ) { for ( int i = 0 ; i < num bytes ; i + + ) { buf [ i + offset ] = ( byte ) ( ( value & ( 0xff l < < ( i * 8 ) ) ) > > ( i * 8 ) ) ; } return buf ; }


disables all used texture units and unbinds textures resets the counts


always clears the current animation on the view using { @ link android view view # clear animation ( ) } , then starts the { @ link android view animation animation } given in the constructor using { @ link android view view # start animation ( android view animation animation ) } and then returns { @ code false } because the animation does not actually put the current resource on the view

public boolean transition ( r current , view adapter adapter ) { view view = adapter get view ( ) ; if ( view ! = null ) { view clear animation ( ) ; animation animation = view transition animation factory build ( view get context ( ) ) ; view start animation ( animation ) ; } return false ; }


maximum replication factor across the indices see { @ link # get replication }

public double get max index replication ( ) { return this max index replication ; }


get an iterator over code blocks which overlap the specified address set

public code block iterator get code blocks containing ( address set view addr set , task monitor monitor ) throws cancelled exception { return new simple block iterator ( this , addr set , monitor ) ; }


tests to determine if the passed object was created with the same parameters

public boolean equals ( final object obj ) { if ( ! ( obj instanceof vertex attribute ) ) { return false ; } return equals ( ( vertex attribute ) obj ) ; }


public string get id ( ) { return id ; }


return the config locations for this web application context , or { @ code null } if none specified


the children of this element < code > repeated aapt pb xml node child = 5 ; < code >

private void remove child ( int index ) { ensure child is mutable ( ) ; child remove ( index ) ; }


see { @ link kafka producer # flush ( ) }


indicate that the entire test run was interrupted

public void test run interrupted ( ) { root node test interrupted ( now ( ) ) ; }


ensures the given array has a given size

public static short [ ] ensure array size ( short [ ] array , int size , short initial value ) { / / is the existing array large enough ? if ( array length > = size ) { / / reinitialize the existing array arrays fill ( array , 0 , size , initial value ) ; } else { / / otherwise create and initialize a new array array = new short [ size ] ; if ( initial value ! = 0 ) { arrays fill ( array , 0 , size , initial value ) ; } } return array ; }


test to verify that server is able to start with valid credentials

public void test valid credentials ( ) throws exception { string server principal = kerberos test utils get server principal ( ) ; server principal = server principal substring ( 0 , server principal last index of ( " @ " ) ) ; map < string , string > auth configs = new hash map < string , string > ( ) ; auth configs put ( quorum auth quorum sasl auth enabled , " true " ) ; auth configs put ( quorum auth quorum server sasl auth required , " true " ) ; auth configs put ( quorum auth quorum learner sasl auth required , " true " ) ; auth configs put ( quorum auth quorum kerberos service principal , server principal ) ; string connect str = start quorum ( 3 , auth configs , 3 ) ; countdown watcher watcher = new countdown watcher ( ) ; zoo keeper zk = new zoo keeper ( connect str , client base connection timeout , watcher ) ; watcher wait for connected ( client base connection timeout ) ; for ( int i = 0 ; i < 10 ; i + + ) { zk create ( " / " + i , new byte [ 0 ] , ids open acl unsafe , create mode persistent ) ; } zk close ( ) ; }


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


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

@ override public t visit event query ( eql base parser event query context ctx ) { return visit children ( ctx ) ; }


adds all the deprecated keys loads mapred - default xml and mapred - site xml

public static void load resources ( ) { add deprecated keys ( ) ; configuration add default resource ( " mapred - default xml " ) ; configuration add default resource ( " mapred - site xml " ) ; configuration add default resource ( " yarn - default xml " ) ; configuration add default resource ( " yarn - site xml " ) ; }


public static void nearby ( team team , float x , float y , float width , float height , cons < unit > cons ) { team data ( ) tree ( ) intersect ( x , y , width , height , cons ) ; }


set a supplier for part writers to use when { @ link # multipart codecs ( ) } are not explicitly configured that ' s the same set of writers as for general except for the multipart writer itself

void set part writers supplier ( supplier < list < http message writer < ? > > > supplier ) { this part writers supplier = supplier ; init typed writers ( ) ; }


read a particular { @ link configuration class } , registering bean definitions for the class itself and all of its { @ link bean } methods

private void load bean definitions for configuration class ( configuration class config class , tracked condition evaluator tracked condition evaluator ) { if ( tracked condition evaluator should skip ( config class ) ) { string bean name = config class get bean name ( ) ; if ( string utils has length ( bean name ) & & this registry contains bean definition ( bean name ) ) { this registry remove bean definition ( bean name ) ; } this import registry remove importing class ( config class get metadata ( ) get class name ( ) ) ; return ; } if ( config class is imported ( ) ) { register bean definition for imported configuration class ( config class ) ; } for ( bean method bean method : config class get bean methods ( ) ) { load bean definitions for bean method ( bean method ) ; } load bean definitions from imported resources ( config class get imported resources ( ) ) ; load bean definitions from registrars ( config class get import bean definition registrars ( ) ) ; }


tests that { @ link doc write response # to x content ( x content builder , to x content params ) } doesn ' t include { @ code forced refresh } unless it is true we can ' t assert this in the yaml tests because " not found " is also " false " there

public void test to x content doesnt include forced refresh unless forced ( ) throws i o exception { doc write response response = new doc write response ( new shard id ( " index " , " uuid " , 0 ) , " id " , sequence numbers unassigned seq no , 17 , 0 , result created ) { / / doc write response is abstract so we have to sneak a subclass in here to test it } ; response set shard info ( new shard info ( 1 , 1 ) ) ; response set forced refresh ( false ) ; try ( x content builder builder = json x content content builder ( ) ) { response to x content ( builder , to x content empty params ) ; try ( x content parser parser = create parser ( json x content json x content , bytes reference bytes ( builder ) ) ) { assert that ( parser map ( ) , not ( has key ( " forced refresh " ) ) ) ; } } response set forced refresh ( true ) ; try ( x content builder builder = json x content content builder ( ) ) { response to x content ( builder , to x content empty params ) ; try ( x content parser parser = create parser ( json x content json x content , bytes reference bytes ( builder ) ) ) { assert that ( parser map ( ) , has entry ( " forced refresh " , true ) ) ; } } }


public boolean set safe mode ( hdfs constants safe mode action action ) throws i o exception { return set safe mode ( action , false ) ; }


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


transforms this fluent iterable into a new one containing objects of the type t

public final < t > fluent iterable < t > map ( function < ? super e , t > function ) { var temporary list = new array list < t > ( ) ; this for each ( e - > temporary list add ( function apply ( e ) ) ) ; return from ( temporary list ) ; }


public rpc context set remote address ( string host , int port ) { if ( port < 0 ) { port = 0 ; } this remote address = inet socket address create unresolved ( host , port ) ; return this ; }


use the { @ link # set database populator database populator } to set up the database

public void after properties set ( ) { execute ( this database populator ) ; }


returns true if the user has selected one and only one range of instructions if there are multiple ranges , this could be for two reasons : 1 ) the user has ( via the mouse ) selected more than one set of address ranges , or 2 ) the user selects a single region but that region spans memory blocks ; this would be interpreted by the program as being 2 distinct selection ranges in both of these cases , we throw an exception with a message that the caller can log if desired

private boolean is selection range valid ( program selection selection ) throws invalid input exception { set < string > block names = new hash set < > ( ) ; address range iterator iter = selection get address ranges ( ) ; while ( iter has next ( ) ) { address range range = iter next ( ) ; address addr = range get min address ( ) ; memory block block = get current program ( ) get memory ( ) get block ( addr ) ; block names add ( block get name ( ) ) ; } if ( block names size ( ) > 1 ) { throw new invalid input exception ( " selection range cannot span memory blocks " ) ; } if ( selection get num address ranges ( ) > 1 ) { throw new invalid input exception ( " selection cannot contain multiple address ranges " ) ; } return selection get num address ranges ( ) = = 1 ; }


the workspace file parsing is cut in several parts and this function returns the index of the part of the workspace file that this value holds for the first part , this index will be 0 , for the second part , it will be 1 and so on

public int get index ( ) { return idx ; }


postmultiplies this matrix with a ( counter - clockwise ) rotation matrix postmultiplication is also used by open g l es ' 1 x gl translategl rotategl scale

public matrix 4 rotate rad ( vector 3 axis , float radians ) { if ( radians = = 0 ) return this ; quat set from axis rad ( axis , radians ) ; return rotate ( quat ) ; }


the following tests are failing on azure and the azure file system code needs to be modified to make them pass a separate work item has been opened for this

public void test move file under parent ( ) throws throwable { }


creates an out - of - band channel builder for load balancer ' s own rpc needs , e g , talking to an external load - balancer service , that is specified by a target string see the documentation on { @ link managed channel builder # for target } for the format of a target string the target string will be resolved by a { @ link name resolver } created according to the target string the load balancer is responsible for closing unused oob channels , and closing all oob channels within { @ link # shutdown }

public managed channel builder < ? > create resolving oob channel builder ( string target ) { throw new unsupported operation exception ( " not implemented " ) ; }


find bean instances that match the required type called during autowiring for the specified bean

protected map < string , object > find autowire candidates ( @ nullable string bean name , class < ? > required type , dependency descriptor descriptor ) { string [ ] candidate names = bean factory utils bean names for type including ancestors ( this , required type , true , descriptor is eager ( ) ) ; map < string , object > result = collection utils new linked hash map ( candidate names length ) ; for ( map entry < class < ? > , object > class object entry : this resolvable dependencies entry set ( ) ) { class < ? > autowiring type = class object entry get key ( ) ; if ( autowiring type is assignable from ( required type ) ) { object autowiring value = class object entry get value ( ) ; autowiring value = autowire utils resolve autowiring value ( autowiring value , required type ) ; if ( required type is instance ( autowiring value ) ) { result put ( object utils identity to string ( autowiring value ) , autowiring value ) ; break ; } } } for ( string candidate : candidate names ) { if ( ! is self reference ( bean name , candidate ) & & is autowire candidate ( candidate , descriptor ) ) { add candidate entry ( result , candidate , descriptor , required type ) ; } } if ( result is empty ( ) ) { boolean multiple = indicates multiple beans ( required type ) ; / / consider fallback matches if the first pass failed to find anything dependency descriptor fallback descriptor = descriptor for fallback match ( ) ; for ( string candidate : candidate names ) { if ( ! is self reference ( bean name , candidate ) & & is autowire candidate ( candidate , fallback descriptor ) & & ( ! multiple | | get autowire candidate resolver ( ) has qualifier ( descriptor ) ) ) { add candidate entry ( result , candidate , descriptor , required type ) ; } } if ( result is empty ( ) & & ! multiple ) { / / consider self references as a final pass / / but in the case of a dependency collection , not the very same bean itself for ( string candidate : candidate names ) { if ( is self reference ( bean name , candidate ) & & ( ! ( descriptor instanceof multi element descriptor ) | | ! bean name equals ( candidate ) ) & & is autowire candidate ( candidate , fallback descriptor ) ) { add candidate entry ( result , candidate , descriptor , required type ) ; } } } } return result ; }


get the older remote application directory for log aggregation

public path get older remote app log dir ( application id app id , string app owner ) throws i o exception { return log aggregation utils get older remote app log dir ( conf , app id , app owner , this remote root log dir , this remote root log dir suffix ) ; }


no - op test so that the class has at least one method , making maven ' s test runner happy


asynchronously stop the snapshot lifecycle management feature see https : www elastic coguideenelasticsearchclientjava - restcurrent java - rest - high - ilm - slm - stop - slm html for more

public cancellable stop s l m async ( stop s l m request request , request options options , action listener < acknowledged response > listener ) { return rest high level client perform request async and parse entity ( request , index lifecycle request converters : : stop s l m , options , acknowledged response : : from x content , listener , empty set ( ) ) ; }


creates a new { @ link create index request builder } with the settings obtained from { @ link # index settings ( ) } the index that is created with this builder will only be allowed to allocate on the number of nodes passed to this method this method uses allocation deciders to filter out certain nodes to allocate the created index on it defines allocation rules based on < code > index routing allocation exclude name < code >

public create index request builder prepare create ( string index , int num nodes , settings builder settings builder ) { settings builder builder = settings builder ( ) put ( index settings ( ) ) put ( settings builder build ( ) ) ; if ( num nodes > 0 ) { internal cluster ( ) ensure at least num data nodes ( num nodes ) ; get exclude settings ( num nodes , builder ) ; } return client ( ) admin ( ) indices ( ) prepare create ( index ) set settings ( builder build ( ) ) ; }


get the { @ link char stream } from which this token source is currently providing tokens

public char stream get input stream ( ) ;


public static int read unsigned int ( byte input in , int zwidth , boolean fill on right ) { int result = 0 ; if ( ! fill on right ) { for ( int i = zwidth ; i > = 0 ; i - - ) { result = ( result > > > 8 ) | ( ( in read byte ( ) & 0xff ) < < 24 ) ; } result > > > = ( 3 - zwidth ) * 8 ; } else { for ( int i = zwidth ; i > = 0 ; i - - ) { result = ( result > > > 8 ) | ( ( in read byte ( ) & 0xff ) < < 24 ) ; } } return result ; }


try to add write lock if it successed , then it can call { @ link # release write lock ( string ) } and it won ' t call if failed

static int try write lock ( string group key ) { cache item group item = cache get ( group key ) ; int result = ( null = = group item ) ? 0 : ( group item rw lock try write lock ( ) ? 1 : - 1 ) ; if ( result < 0 ) { default log warn ( " [ write - lock ] failed , { } , { } " , result , group key ) ; } return result ; }


verify the following scenario a put a live node to maintenance = > 1 maintenance , 2 live b the maintenance node becomes dead = > block map still has 1 maintenance , 2 live c take the node out of maintenance = > nn should schedule the replication and end up with 3 live

public void test take dead node out of maintenance ( ) throws exception { log info ( " starting test take dead node out of maintenance " ) ; final int num namenodes = 1 ; final int num datanodes = 4 ; start cluster ( num namenodes , num datanodes ) ; final path file = new path ( " / test take dead node out of maintenance dat " ) ; final int replicas = 3 ; final file system file sys = get cluster ( ) get file system ( 0 ) ; final f s namesystem ns = get cluster ( ) get namesystem ( 0 ) ; write file ( file sys , file , replicas , 1 ) ; final datanode info node outof service = take node outof service ( 0 , get first block first replica uuid ( file sys , file ) , long max value , null , admin states in maintenance ) ; check with retry ( ns , file sys , file , replicas - 1 , node outof service ) ; final d f s client client = get dfs client ( 0 ) ; assert equals ( " all datanodes must be alive " , num datanodes , client datanode report ( datanode report type live ) length ) ; get cluster ( ) stop data node ( node outof service get xfer addr ( ) ) ; d f s test util wait for datanode state ( get cluster ( ) , node outof service get datanode uuid ( ) , false , 20000 ) ; assert equals ( " maintenance node shouldn ' t be alive " , num datanodes - 1 , client datanode report ( datanode report type live ) length ) ; / / dead maintenance node ' s blocks should remain in block map check with retry ( ns , file sys , file , replicas - 1 , node outof service ) ; / / when dead maintenance mode is transitioned to out of maintenance mode , / / its blocks should be removed from block map / / this will then trigger replication to restore the live replicas back / / to replication factor put node in service ( 0 , node outof service get datanode uuid ( ) ) ; check with retry ( ns , file sys , file , replicas , node outof service , null ) ; cleanup file ( file sys , file ) ; }


gets the human - oriented string for the given access flags subclasses must override this method

protected abstract string human access flags ( int access flags ) ;


verify robust reflection converter can handle missing fields in a class extending throwable exception ( default throwable converter registered by x stream calls reflection converter directly , rather than our robust reflection converter replacement )

public void unmarshal throwable missing field ( ) { level old level = disable logging ( ) ; baz baz = new baz ( ) ; baz my failure = new exception ( " foo " ) ; x stream 2 xs = new x stream 2 ( ) ; string xml = xs to x m l ( baz ) ; baz = ( baz ) xs from x m l ( xml ) ; assert equals ( " foo " , baz my failure get message ( ) ) ; baz = ( baz ) xs from x m l ( " < hudson util x stream 2 test - baz > < my failure > " + " < missing field > true < / missing field > " + " < detail message > hoho < / detail message > " + " < stack trace > < trace > " + " hudson util x stream 2 test test unmarshal throwable missing field ( x stream 2 test java : 97 ) " + " < / trace > < / stack trace > " + " < / my failure > < / hudson util x stream 2 test - baz > " ) ; / / object should load , despite " missing field " in xml above assert equals ( " hoho " , baz my failure get message ( ) ) ; enable logging ( old level ) ; }


asserts that the x content filters of a { @ link filtered monitoring doc } contains the common filters and the expected custom ones

private void assert x content filters ( final f document ) { final set < string > expected filters = sets union ( common xcontent filters , get expected x content filters ( ) ) ; final set < string > actual filters = document get filters ( ) ; expected filters for each ( filter - > assert that ( actual filters , has item ( filter ) ) ) ; assert that ( actual filters size ( ) , equal to ( expected filters size ( ) ) ) ; }


d b c query transformer create query transformer ( @ not null d b c query transform type type ) ;


get the value of the ' { @ code name } ' attribute

protected string get name ( ) throws jsp exception { return this name ; }


generates a full segment ( aligned to bytes per long ) of the given byte amount size

private generate result generate full segment ( int byte am , long start offset , data hasher hasher ) { if ( byte am < = 0 ) { throw new illegal argument exception ( " byte amount must be greater than zero and not " + byte am ) ; } if ( ( byte am % bytes per long ) ! = 0 ) { throw new illegal argument exception ( " byte amount " + byte am + " must be a multiple of " + bytes per long ) ; } / / generate all the segments byte buffer all bytes = byte buffer wrap ( new byte [ byte am ] ) ; long offset = start offset ; byte buffer buf = byte buffer wrap ( new byte [ bytes per long ] ) ; for ( long i = 0 ; i < byte am ; i + = bytes per long ) { buf rewind ( ) ; buf put long ( hasher generate ( offset ) ) ; buf rewind ( ) ; all bytes put ( buf ) ; offset + = bytes per long ; } all bytes rewind ( ) ; return new generate result ( offset , all bytes ) ; }


tests that thin l t o is not enabled for xbinaryfdo with - - features = autofdo implicit thinlto and - - features = fdo implicit thinlto

public void test x binary fdo no auto fdo or fdo implicit thin lto ( ) throws exception { scratch file ( " pkg / build " , " " , " cc binary ( name = ' bin ' , " , " srcs = [ ' binfile cc ' , ] , " , " malloc = ' / / base : system malloc ' ) " , " fdo profile ( name = ' out xfdo ' , profile = ' profiles xfdo ' ) " ) ; scratch file ( " pkg / binfile cc " , " int main ( ) { } " ) ; analysis mock get ( ) cc support ( ) setup cc toolchain config ( mock tools config , cc toolchain config builder ( ) with features ( cpp rule classes thin lto , mock cc support host and nonhost configuration features , cpp rule classes enable fdo thinlto , mock cc support fdo implicit thinlto , cpp rule classes supports start end lib , cpp rule classes enable afdo thinlto , mock cc support autofdo implicit thinlto , cpp rule classes xbinaryfdo ) ) ; use configuration ( " - - xbinary fdo = / / pkg : out xfdo " , " - - compilation mode = opt " , " - - features = autofdo implicit thinlto " , " - - features = fdo implicit thinlto " ) ; artifact bin artifact = get files to build ( get configured target ( " / / pkg : bin " ) ) get singleton ( ) ; cpp link action link action = ( cpp link action ) get generating action ( bin artifact ) ; assert that ( link action get outputs ( ) ) contains exactly ( bin artifact ) ; lto backend action backend action = ( lto backend action ) get predecessor by input name ( link action , " pkg / bin lto / pkg / objs / bin / pkg / binfile o " ) ; / / we should not have a thin l t o backend action assert that ( backend action ) is null ( ) ; }


whether all files of interest should be treated as potentially modified

public boolean treat everything as modified ( ) { return modified = = null ; }


return the message source in use with this request

public message source get message source ( ) { return this message source ; }


boolean on pretreatment ( context context , postcard postcard ) ;


number of non - fatal errors detected while writing the snapshot diff and i node reference sections

public long get num image errors ( ) { return num image errors ; }


post user : create user this can only be done by the logged in user

default response entity < void > create user ( @ api param ( value = " created user object " , required = true ) @ valid @ request body user body ) { return get delegate ( ) create user ( body ) ; }


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


remove all pending write operation and fail them with the given { @ link throwable } the message will be released via { @ link reference count util # safe release ( object ) }

public void remove and fail all ( throwable cause ) { assert ctx executor ( ) in event loop ( ) ; object util check not null ( cause , " cause " ) ; / / it is possible for some of the failed promises to trigger more writes the new writes / / will " revive " the queue , so we need to clean them up until the queue is empty for ( pending write write = head ; write ! = null ; write = head ) { head = tail = null ; size = 0 ; bytes = 0 ; while ( write ! = null ) { pending write next = write next ; reference count util safe release ( write msg ) ; channel promise promise = write promise ; recycle ( write , false ) ; safe fail ( promise , cause ) ; write = next ; } } assert empty ( ) ; }


use the http cookie value as the cache key so multiple executions in the same hystrix request context will respond from cache

protected string get cache key ( ) { return http cookie get value ( ) ; }


a given grammar t , return a blank listener implementation such as t base listener java , if we ' re using the java target

public string get base listener file name ( boolean header ) { code generator gen = get code generator ( ) ; grammar g = gen g ; assert g name ! = null ; return g name to lower case ( ) + " base listener go " ; }


public int get register count ( ) { return 2 ; }


public int find column ( string column label ) throws s q l exception { return 0 ; }


return http headers with an " accept " header , or an empty instance

public http headers get response headers ( ) { if ( collection utils is empty ( this supported media types ) ) { return http headers empty ; } http headers headers = new http headers ( ) ; headers set accept ( this supported media types ) ; return headers ; }


convert { @ code text } into html , adding tags and styling to match any styling spans present all textual content is html - escaped during the conversion note : the current implementation does not handle overlapping spans correctly , it will generate overlapping html tags that are invalid in most cases this won ' t be a problem because : most subtitle formats use a tagged structure to carry formatting information ( e g web v t t and ttml ) , so the { @ link spanned } objects created by these decoders likely won ' t have overlapping spans web view chromium ( the intended destination of this html ) gracefully handles overlapping tags and usually renders the same result as spanned text in a text view

public static html and css convert ( @ nullable char sequence text , float display density ) { if ( text = = null ) { return new html and css ( " " , / * css rule sets = * / immutable map of ( ) ) ; } if ( ! ( text instanceof spanned ) ) { return new html and css ( escape html ( text ) , / * css rule sets = * / immutable map of ( ) ) ; } spanned spanned = ( spanned ) text ; / / use css inheritance to ensure background color spans affect all inner elements set < integer > background colors = new hash set < > ( ) ; for ( background color span background color span : spanned get spans ( 0 , spanned length ( ) , background color span class ) ) { background colors add ( background color span get background color ( ) ) ; } hash map < string , string > css rule sets = new hash map < > ( ) ; for ( int background color : background colors ) { css rule sets put ( html utils css all class descendants selector ( " bg " + background color ) , util format invariant ( " background - color : % s ; " , html utils to css rgba ( background color ) ) ) ; } sparse array < transition > span transitions = find span transitions ( spanned , display density ) ; string builder html = new string builder ( spanned length ( ) ) ; int previous transition = 0 ; for ( int i = 0 ; i < span transitions size ( ) ; i + + ) { int index = span transitions key at ( i ) ; html append ( escape html ( spanned sub sequence ( previous transition , index ) ) ) ; transition transition = span transitions get ( index ) ; collections sort ( transition spans removed , span info for closing tags ) ; for ( span info span info : transition spans removed ) { html append ( span info closing tag ) ; } collections sort ( transition spans added , span info for opening tags ) ; for ( span info span info : transition spans added ) { html append ( span info opening tag ) ; } previous transition = index ; } html append ( escape html ( spanned sub sequence ( previous transition , spanned length ( ) ) ) ) ; return new html and css ( html to string ( ) , css rule sets ) ; }


syncs the given location with the underlying storage unless already synced this method might return immediately without actually fsyncing the location until the sync listener is called yet , unless there is already another thread fsyncing the transaction log the caller thread will be hijacked to run the fsync for all pending fsync operations this method allows indexing threads to continue indexing without blocking on fsync calls we ensure that there is only one thread blocking on the sync an all others can continue indexing note : if the sync listener throws an exception when it ' s processed the exception will only be logged users should make sure that the listener handles all exception cases internally

public final void sync ( translog location location , consumer < exception > sync listener ) { verify not closed ( ) ; translog sync processor put ( location , sync listener ) ; }


performs a cas operation on the { @ link # value } field

boolean cas value ( abstract future < ? > future , object expect , object update ) { return unsafe compare and swap object ( future , value offset , expect , update ) ; }


post fakecreate xml item : creates an xml item this route creates an xml item

default response entity < void > create xml item ( @ api param ( value = " xml item body " , required = true ) @ valid @ request body xml item xml item ) { return new response entity < > ( http status not implemented ) ; }


use this option to set up a server from a { @ link router function } internally the provided configuration is passed to { @ code router functions # to web handler } the resulting web flux application will be tested without an http server using a mock request and response

static router function spec bind to router function ( router function < ? > router function ) { return new default router function spec ( router function ) ; }


public static void main ( string [ ] args ) { mongo connection properties loader load ( ) ; var injector = guice create injector ( new lottery module ( ) ) ; var administration = injector get instance ( lottery administration class ) ; var service = injector get instance ( lottery service class ) ; sample data submit tickets ( service , 20 ) ; var console administration = new console administration srv impl ( administration , logger ) ; try ( var scanner = new scanner ( system in ) ) { var exit = false ; while ( ! exit ) { print main menu ( ) ; var cmd = read string ( scanner ) ; if ( " 1 " equals ( cmd ) ) { console administration get all submitted tickets ( ) ; } else if ( " 2 " equals ( cmd ) ) { console administration perform lottery ( ) ; } else if ( " 3 " equals ( cmd ) ) { console administration reset lottery ( ) ; } else if ( " 4 " equals ( cmd ) ) { exit = true ; } else { logger info ( " unknown command : { } " , cmd ) ; } } } }


returns the intersection of the given column and given item

point get origin ( grid column column , int item ) { int x = 0 ; if ( row header visible ) { x + = row header width ; } x - = get h scroll selection in pixels ( ) ; for ( int i = 0 ; i < columns size ( ) ; i + + ) { grid column col iter = columns get ( i ) ; if ( col iter = = column ) { break ; } x + = col iter get width ( ) ; } int y = 0 ; if ( item > = 0 ) { if ( column headers visible ) { y + = header height ; } int curr index = get top index ( ) ; if ( item = = - 1 ) { swt error ( swt error invalid argument ) ; } while ( curr index ! = item ) { if ( curr index < item ) { y + = get item height ( ) + 1 ; curr index + + ; } else if ( curr index > item ) { curr index - - ; y - = get item height ( ) + 1 ; } } } else if ( column headers visible & & column get parent ( ) ! = null ) { for ( grid column parent = column get parent ( ) ; parent ! = null ; parent = parent get parent ( ) ) { y + = parent get header height ( false , false ) ; } } return new point ( x , y ) ; }


{ @ inherit doc } the requested scope must not include any scope not originally granted by the resource owner , and if omitted is treated as equal to the scope originally granted by the resource owner

protected set < string > extract requested scopes by token ( final set < string > requested scopes , final o auth 2 0 token token , final http servlet request request ) { if ( ! requested scopes is empty ( ) & & ! requested scopes equals ( token get scopes ( ) ) ) { logger error ( " requested scopes [ { } ] exceed the granted scopes [ { } ] for token [ { } ] " , requested scopes , token get scopes ( ) , token get id ( ) ) ; throw new o auth 2 0 unauthorized scope request exception ( token get id ( ) ) ; } return new tree set < > ( token get scopes ( ) ) ; }


gets an integer value that has bits set as flags indicating the types of differences that exist between the two memory blocks

private int get diff flags ( ) { if ( block 1 = = null ) { if ( block 2 = = null ) { return 0 ; } return all ; } if ( block 2 = = null ) { return all ; } int flags = 0 ; if ( ! block 1 get name ( ) equals ( block 2 get name ( ) ) ) { flags | = name ; } if ( ! block 1 get start ( ) equals ( block 2 get start ( ) ) ) { flags | = start address ; } if ( ! block 1 get end ( ) equals ( block 2 get end ( ) ) ) { flags | = end address ; } if ( block 1 get size ( ) ! = block 2 get size ( ) ) { flags | = size ; } if ( block 1 is read ( ) ! = block 2 is read ( ) ) { flags | = read ; } if ( block 1 is write ( ) ! = block 2 is write ( ) ) { flags | = write ; } if ( block 1 is execute ( ) ! = block 2 is execute ( ) ) { flags | = execute ; } if ( block 1 is volatile ( ) ! = block 2 is volatile ( ) ) { flags | = volatile ; } if ( ! block 1 get type ( ) equals ( block 2 get type ( ) ) ) { flags | = type ; } if ( block 1 is initialized ( ) ! = block 2 is initialized ( ) ) { flags | = init ; } if ( ! system utilities is equal ( block 1 get source name ( ) , block 2 get source name ( ) ) ) { flags | = source ; } if ( ! system utilities is equal ( block 1 get comment ( ) , block 2 get comment ( ) ) ) { flags | = comment ; } return flags ; }


check if the current model add or upgrade an unique or not null column

private boolean has new unique or not null column ( ) { collection < column model > column models = m table model get column models ( ) ; for ( column model column model : column models ) { if ( column model is id column ( ) ) continue ; / / id don ' t check unique or nullable , we never upgrade it column model column model d b = m table model d b get column model by name ( column model get column name ( ) ) ; if ( column model is unique ( ) ) { if ( column model d b = = null | | ! column model d b is unique ( ) ) { return true ; } } if ( column model d b ! = null & & ! column model is nullable ( ) & & column model d b is nullable ( ) ) { return true ; } } return false ; }


return an instance of the bean with the given name in this factory , creating it via the given factory method

object instantiate ( root bean definition bd , @ nullable string bean name , bean factory owner , @ nullable object factory bean , method factory method , object args ) throws beans exception ;


dump transient context setting details note : method has no affect unless constructed with verbose logging mode

public void dump context set ( sleigh parser context pos , int num , int value , int mask ) { if ( ! is verbose enabled ( ) ) { return ; } int [ ] current value = new int [ ( context base register get minimum byte size ( ) + 3 ) / 4 ] ; for ( int i = 0 ; i < current value length ; i + + ) { current value [ i ] = pos get context bytes ( i * 4 , 4 ) ; } current value [ num ] = ( current value [ num ] & ( ~ mask ) ) | ( mask & value ) ; / / combine with current value using mask byte [ ] mask actual value = new byte [ current value length * 4 * 2 ] ; system arraycopy ( get bytes ( current value ) , 0 , mask actual value , mask actual value length / 2 , mask actual value length / 2 ) ; int byte offset = num * 4 ; system arraycopy ( get bytes ( new int [ ] { mask } ) , 0 , mask actual value , byte offset , 4 ) ; register value actual value = new register value ( context base register , mask actual value ) ; indent ( 2 ) ; int base reg size = context base register get minimum byte size ( ) * 8 ; for ( register reg : context base register get child registers ( ) ) { register value child actual value = actual value get register value ( reg ) ; if ( child actual value has any value ( ) ) { big integer actual = child actual value get unsigned value ignore mask ( ) ; int msb = base reg size - reg get least significat bit in base register ( ) - 1 ; int lsb = msb - reg get bit length ( ) + 1 ; append ( " set " + reg get name ( ) + " ( " + lsb + " , " + msb + " ) = 0x " + long to hex string ( actual long value ( ) ) + " \ n " ) ; } } drop indent ( 2 ) ; }


removes the embedded console notes in the given log line

public static string remove notes ( string line ) { while ( true ) { int idx = line index of ( preamble str ) ; if ( idx < 0 ) return line ; int e = line index of ( postamble str , idx ) ; if ( e < 0 ) return line ; line = line substring ( 0 , idx ) + line substring ( e + postamble str length ( ) ) ; } }


customizes { @ link service instance the service instance }

void customize ( service instance service instance ) ;


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


test that collisions in the block group id space are handled gracefully

public void test trigger block group id collision ( ) throws i o exception { long block group id initial value = block grp id generator get current value ( ) ; / / create a file with a few blocks to rev up the global block id / / counter path path 1 = new path ( ec dir , " test block grp id collision detection file 1 dat " ) ; d f s test util create file ( fs , path 1 , cell size , file len , block size , replication , seed ) ; list < located block > blocks 1 = d f s test util get all blocks ( fs , path 1 ) ; assert that ( " wrong block grps " , blocks 1 size ( ) , is ( block grp count ) ) ; / / rewind the block id counter in the name system object this will result / / in block id collisions when we try to allocate new blocks block grp id generator set current value ( block group id initial value ) ; / / trigger collisions by creating a new file path path 2 = new path ( ec dir , " test block grp id collision detection file 2 dat " ) ; d f s test util create file ( fs , path 2 , cell size , file len , block size , replication , seed ) ; list < located block > blocks 2 = d f s test util get all blocks ( fs , path 2 ) ; assert that ( " wrong block grps " , blocks 2 size ( ) , is ( block grp count ) ) ; / / make sure that file 1 and file 2 block i ds are different for ( located block loc block 1 : blocks 1 ) { long block id 1 = loc block 1 get block ( ) get block id ( ) ; for ( located block loc block 2 : blocks 2 ) { long block id 2 = loc block 2 get block ( ) get block id ( ) ; assert that ( " block grp id mismatches ! " , block id 1 , is ( not ( block id 2 ) ) ) ; } } }


tests that a different slot can fulfill a pending slot request if the pending slot request has a pending task manager slot assigned , it should be freed

public void test registration of different slot ( ) throws exception { final int number slots = 1 ; final testing resource actions resource actions = new testing resource actions builder ( ) build ( ) ; try ( final slot manager impl slot manager = create slot manager ( resource manager id generate ( ) , resource actions , number slots ) ) { final job i d job id = new job i d ( ) ; final resource profile requested slot profile = resource profile unknown ; assert that ( slot manager register slot request ( create slot request ( job id , requested slot profile ) ) , is ( true ) ) ; assert that ( slot manager get number pending task manager slots ( ) , is ( number slots ) ) ; final int number offered slots = 1 ; final task executor connection task executor connection = create task executor connection ( ) ; final resource profile offered slot profile = resource profile from resources ( 2 0 , 2 ) ; final slot report slot report = create slot report ( task executor connection get resource i d ( ) , number offered slots , offered slot profile , slot manager impl test : : create empty slot status ) ; slot manager register task manager ( task executor connection , slot report , resource profile any , resource profile any ) ; assert that ( slot manager get number registered slots ( ) , is ( number offered slots ) ) ; assert that ( slot manager get number pending task manager slots ( ) , is ( number slots ) ) ; assert that ( slot manager get number assigned pending task manager slots ( ) , is ( 0 ) ) ; } }


public void shutdown ( ) { projection renderer shutdown ( ) ; }


extracts a { @ link request metadata } from a { @ link metadata } and returns it if it exists if it does not exist , returns { @ code null }

public static @ nullable request metadata request metadata from headers ( metadata headers ) { return headers get ( metadata key ) ; }


public void trigger scheduled tasks ( ) { trigger periodic scheduled tasks ( ) ; trigger non periodic scheduled tasks ( ) ; }


returns whether data peeked from the current position in { @ code input } is consistent with the input being an unfragmented mp4 file

public static boolean sniff unfragmented ( extractor input input ) throws i o exception { return sniff internal ( input , false ) ; }


determines if the given signature represents a dyld cache signature with an architecture we support

public final static boolean is dyld cache ( string signature ) { for ( dyld architecture architecture : dyld architecture architectures ) { if ( architecture get signature ( ) equals ( signature ) ) { return true ; } } return false ; }