check the db name is default database or not if it ' s same as db name in litepal xml , then it is default database

private static boolean is default database ( string db name ) { if ( base utility is lite pal x m l exists ( ) ) { if ( ! db name ends with ( const config db name suffix ) ) { db name = db name + const config db name suffix ; } lite pal config config = lite pal parser parse lite pal configuration ( ) ; string default db name = config get db name ( ) ; if ( ! default db name ends with ( const config db name suffix ) ) { default db name = default db name + const config db name suffix ; } return db name equals ignore case ( default db name ) ; } return false ; }


authenticate a login attempt this method is the heart of a { @ link abstract password based security realm } if the user name and the password pair matches , retrieve the information about this user and return it as a { @ link user details } object { @ link org springframework security core userdetails user } is a convenient implementation to use , but if your backend offers additional data , you may want to use your own subtype so that the rest of hudson can use those additional information ( such as e - mail address - - - see mail address resolver ) properties like { @ link user details # get password ( ) } make no sense , so just return an empty value from it the only information that you need to pay real attention is { @ link user details # get authorities ( ) } , which is a list of rolesgroups that the user is in at minimum , this must contain { @ link # authenticated authority } ( which indicates that this user is authenticated and not anonymous ) , but if your backend supports a notion of groups , you should make sure that the authorities contain one entry per one group this enables users to control authorization based on groups if the user name and the password pair doesn ' t match , throw { @ link authentication exception } to reject the login attempt

protected user details authenticate 2 ( string username , string password ) throws authentication exception { if ( util is overridden ( abstract password based security realm class , get class ( ) , " authenticate " , string class , string class ) ) { try { return authenticate ( username , password ) to spring ( ) ; } catch ( org acegisecurity acegi security exception x ) { throw x to spring ( ) ; } } else { throw new abstract method error ( " implement authenticate 2 " ) ; } }


returns all proto source roots in this lib ( { @ code current proto source root } ) and in its transitive dependencies assumes { @ code current proto source root } is the same as the package name

private static nested set < string > compute transitive proto source roots ( immutable list < proto info > proto deps , string current proto source root ) { nested set builder < string > proto path = nested set builder stable order ( ) ; proto path add ( current proto source root ) ; for ( proto info provider : proto deps ) { proto path add transitive ( provider get transitive proto source roots ( ) ) ; } return proto path build ( ) ; }


tests that a dependency is invalid when both rules add environments to their defaults and the depender adds environments not added by the dependency

public void invalid compatibility constraints ( ) throws exception { new environment group maker ( " buildenv / foo " ) set environments ( " a " , " b " , " c " ) set defaults ( " a " ) make ( ) ; scratch file ( " hello / build " , get dependency rule ( compatible with ( " / / buildenv / foo : c " ) ) , get depending rule ( compatible with ( " / / buildenv / foo : b " , " / / buildenv / foo : c " ) ) ) ; reporter remove handler ( fail fast handler ) ; assert that ( get configured target ( " / / hello : main " ) ) is null ( ) ; assert contains event ( " dependency / / hello : dep doesn ' t support expected environment : / / buildenv / foo : b " ) ; }


transform all annotations on a single type , member or parameter

private void transform annotation set ( index map index map , dex section set in ) { contents out annotation sets size + + ; annotation set out assert four byte aligned ( ) ; index map put annotation set offset ( set in get position ( ) , annotation set out get position ( ) ) ; int size = set in read int ( ) ; annotation set out write int ( size ) ; for ( int j = 0 ; j < size ; j + + ) { annotation set out write int ( index map adjust annotation ( set in read int ( ) ) ) ; } }


suppresses the given exception ( { @ code suppressed } ) which was thrown when attempting to close the given closeable { @ code thrown } is the exception that is actually being thrown from the method implementations of this method should not throw under any circumstances

void suppress ( closeable closeable , throwable thrown , throwable suppressed ) ;


calculate a resource ' s min share ratios the { @ code ratios } array will be populated with the { @ code resource } divided by { @ code min share } for each resource type if the min shares are 5 mb and 10 vcores , and the usage ( { @ code resource } ) is 10 mb and 5 cpu , the ratios will be 2 and 0 5 the { @ code ratios } array must be n x 3 , where n is the number of resource types only the third index of the inner arrays in the { @ code ratios } array will be used , e g { @ code ratios [ x ] [ 2 ] }

void calculate min share ratios ( resource resource , resource min share , float [ ] [ ] ratios ) { resource information [ ] resource info = resource get resources ( ) ; resource information [ ] min share info = min share get resources ( ) ; for ( int i = 0 ; i < min share info length ; i + + ) { ratios [ i ] [ 2 ] = resource info [ i ] get value ( ) / ( float ) min share info [ i ] get value ( ) ; } }


public boolean rename ( final path src , final path dst ) throws i o exception { long start time = system current time millis ( ) ; long thread id = thread current thread ( ) get id ( ) ; log debug ( " rename path { } to { } start " , src , dst ) ; try { if ( enable posix ) { return o b s posix bucket utils rename based on posix ( this , src , dst ) ; } else { return o b s object bucket utils rename based on object ( this , src , dst ) ; } } catch ( obs exception e ) { throw o b s common utils translate exception ( " rename ( " + src + " , " + dst + " ) " , src , e ) ; } catch ( rename failed exception e ) { log error ( e get message ( ) ) ; return e get exit code ( ) ; } catch ( file not found exception e ) { log error ( e to string ( ) ) ; return false ; } finally { long end time = system current time millis ( ) ; log debug ( " rename path { } to { } finished , thread : { } , " + " time used in milli sec : { } " , src , dst , thread id , end time - start time ) ; } }


removes the mapping from the specified key , if there was any

public void delete ( long key ) { int i = binary search ( m keys , 0 , m size , key ) ; if ( i > = 0 ) { if ( m values [ i ] ! = deleted ) { m values [ i ] = deleted ; m garbage = true ; } } }


public void accept ( visitor visitor ) { visitor visit throwing insn ( this ) ; }


public void visit constant ( int opcode , int offset , int length , constant cst , int value ) { visit common ( offset , length , true ) ; if ( ( cst instanceof cst member ref ) | | ( cst instanceof cst type ) | | ( cst instanceof cst string ) ) { / * * instructions with these sorts of constants have the * possibility of throwing , so this instruction needs to * end its block ( since it can throw , and possible - throws * are branch points ) * / visit throwing ( offset , length , true ) ; } }


shows a dialog asking the user if they really , really want to cancel the task

private boolean prompt to verify cancel ( ) { boolean user says yes = option dialog show yes no dialog ( get component ( ) , " cancel ? " , " do you really want to cancel \ " " + get title ( ) + " \ " ? " ) = = option dialog option one ; return user says yes ; }


public void get user by name test ( ) { string username = null ; / / user response = api get user by name ( username ) ; / / assert not null ( response ) ; / / todo : test validations }


loads a shared library with the given name for the platform the application is running on the name should not contain a prefix ( e g ' lib ' ) or suffix ( e g ' dll )

public synchronized void load ( string shared lib name ) { if ( loaded libraries contains ( shared lib name ) ) return ; boolean is windows = system get property ( " os name " ) contains ( " windows " ) ; boolean is linux = system get property ( " os name " ) contains ( " linux " ) ; boolean is mac = system get property ( " os name " ) contains ( " mac " ) ; boolean is android = false ; boolean is 6 4 bit = system get property ( " os arch " ) contains ( " 64 " ) | | system get property ( " os arch " ) starts with ( " armv 8 " ) ; boolean is arm = system get property ( " os arch " ) equals ( " arm " ) | | system get property ( " os arch " ) starts with ( " aarch 6 4 " ) ; string vm = system get property ( " java vm name " ) ; if ( vm ! = null & & vm contains ( " dalvik " ) ) { is android = true ; is windows = false ; is linux = false ; is mac = false ; is 6 4 bit = false ; } boolean loaded = false ; if ( is windows ) { if ( library finder ! = null ) loaded = load library ( library finder get shared library name windows ( shared lib name , is 6 4 bit , natives zip ) ) ; else if ( ! is 6 4 bit ) loaded = load library ( shared lib name + " dll " ) ; else loaded = load library ( shared lib name + " 64 dll " ) ; } if ( is linux ) { if ( library finder ! = null ) loaded = load library ( library finder get shared library name linux ( shared lib name , is 6 4 bit , is arm , natives zip ) ) ; else if ( ! is 6 4 bit ) { if ( is arm ) loaded = load library ( " lib " + shared lib name + " arm so " ) ; else loaded = load library ( " lib " + shared lib name + " so " ) ; } else { if ( is arm ) loaded = load library ( " lib " + shared lib name + " arm 6 4 so " ) ; else loaded = load library ( " lib " + shared lib name + " 64 so " ) ; } } if ( is mac ) { if ( library finder ! = null ) loaded = load library ( library finder get shared library name mac ( shared lib name , is 6 4 bit , natives zip ) ) ; else if ( ! is 6 4 bit ) loaded = load library ( " lib " + shared lib name + " dylib " ) ; else loaded = load library ( " lib " + shared lib name + " 64 dylib " ) ; } if ( is android ) { if ( library finder ! = null ) system load library ( library finder get shared library name android ( shared lib name , natives zip ) ) ; else system load library ( shared lib name ) ; loaded = true ; } if ( loaded ) loaded libraries add ( shared lib name ) ; }


import spring bean definitions from either xml or groovy sources into the current bean builder instance

public void import beans ( string resource pattern ) throws i o exception { load bean definitions ( resource pattern ) ; }


private decryptor get decryptor ( ) throws i o exception { decryptor decryptor = decryptor pool poll ( ) ; if ( decryptor = = null ) { try { decryptor = codec create decryptor ( ) ; } catch ( general security exception e ) { throw new i o exception ( e ) ; } } return decryptor ; }


public static void setup cluster ( ) throws exception { job conf conf = new job conf ( ) ; assume session tests enabled ( conf ) ; disable filesystem caching ( conf ) ; cluster = deploy service ( conf , new mini kerberized hadoop cluster ( ) ) ; }


makes the request to return the current snapshot

public get snapshots request builder set current snapshot ( ) { request snapshots ( new string [ ] { get snapshots request current snapshot } ) ; return this ; }


adds a placeholder tree artifact exec path when the command line is used in an action template , the placeholder will be replaced by the exec path of a { @ link tree file artifact } inside the tree artifact at execution time for each expanded action

public builder add placeholder tree artifact exec path ( @ nullable artifact tree artifact ) { if ( tree artifact ! = null ) { preconditions check state ( ! tree artifacts requested ) ; tree artifact inputs add ( tree artifact ) ; arguments add ( new tree file artifact exec path arg ( tree artifact ) ) ; } return this ; }


returns a local artifact and puts its metadata into the action input map

private artifact create local artifact ( string path fragment , string contents , action input map inputs ) throws i o exception { path p = output root get root ( ) as path ( ) get relative ( path fragment ) ; file system utils write content ( p , standard charsets utf 8 , contents ) ; artifact a = actions test util create artifact ( output root , p ) ; path path = a get path ( ) ; / / caution : there ' s a race condition between stating the file and computing the / / digest we need to stat first , since we ' re using the stat to detect changes / / we follow symlinks here to be consistent with get digest inputs put with no dep owner ( a , file artifact value create from stat ( path , path stat ( symlinks follow ) , true ) ) ; return a ; }


returns the validation method to use for geo coordinates

public geo validation method get validation method ( ) { return this validation method ; }


count number of records of the original { @ link k table } that got { @ link k table # group by ( key value mapper ) mapped } to the same key into a new instance of { @ link k table } records with { @ code null } key are ignored the result is written into a local { @ link key value store } ( which is basically an ever - updating materialized view ) that can be queried using the provided { @ code queryable store name } furthermore , updates to the store are sent downstream into a { @ link k table } changelog stream not all updates might get sent downstream , as an internal cache is used to deduplicate consecutive updates to the same key the rate of propagated updates depends on your input data rate , the number of distinct keys , the number of parallel running kafka streams instances , and the { @ link streams config configuration } parameters for { @ link streams config # cache max bytes buffering config cache size } , and { @ link streams config # commit interval ms config commit interval } to query the local { @ link read only key value store } it must be obtained via { @ link kafka streams # store ( store query parameters ) kafka streams # store ( ) } : { @ code kafka streams streams = counting words read only key value store < k , value and timestamp < long > > local store = streams store ( queryable store name , queryable store types < k , value and timestamp < long > > timestamped key value store ( ) ) ; k key = " some - word " ; value and timestamp < long > count for word = local store get ( key ) ; key must be local ( application state is shared over all running kafka streams instances ) } for non - local keys , a custom rpc mechanism must be implemented using { @ link kafka streams # all metadata ( ) } to query the value of the key on a parallel running instance of your kafka streams application for failure and recovery the store will be backed by an internal changelog topic that will be created in kafka therefore , the store name defined by the materialized instance must be a valid kafka topic name and cannot contain characters other than ascii alphanumerics , ' ' , ' ' and ' - ' the changelog topic will be named " $ { application id } - $ { store name } - changelog " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " store name " is the provide store name defined in { @ code materialized } , and " - changelog " is a fixed suffix you can retrieve all generated internal topic names via { @ link topology # describe ( ) }

k table < k , long > count ( final named named , final materialized < k , long , key value store < bytes , byte [ ] > > materialized ) ;


get authentications ( key : authentication name , value : authentication )

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


returns the instruction defined before the specified instruction or null if no instruction exists the instruction that is returned does not have to be contiguous

public final instruction get instruction before ( instruction instruction ) { return get instruction before ( instruction get min address ( ) ) ; }


public void set label ( string label ) { new label ( label ) ; measure ( ) ; repaint ( ) ; }


creates list of users with given input array < b > 0 < b > - successful operation

public response entity < void > create users with array input with http info ( list < user > body ) throws rest client exception { object post body = body ; / / verify the required parameter ' body ' is set if ( body = = null ) { throw new http client error exception ( http status bad request , " missing the required parameter ' body ' when calling create users with array input " ) ; } string path = api client expand path ( " / user / create with array " , collections < string , object > empty map ( ) ) ; final multi value map < string , string > query params = new linked multi value map < string , string > ( ) ; final http headers header params = new http headers ( ) ; final multi value map < string , string > cookie params = new linked multi value map < string , string > ( ) ; final multi value map < string , object > form params = new linked multi value map < string , object > ( ) ; final string [ ] local var accepts = { } ; final list < media type > local var accept = api client select header accept ( local var accepts ) ; final string [ ] content types = { } ; final media type content type = api client select header content type ( content types ) ; string [ ] auth names = new string [ ] { } ; parameterized type reference < void > return type = new parameterized type reference < void > ( ) { } ; return api client invoke a p i ( path , http method post , query params , post body , header params , cookie params , form params , local var accept , content type , auth names , return type ) ; }


creates a symbol if it doesn ' t already exist at the specified address in the program by adding an underscore and the address to the symbol prefix string that is passed to it

public static symbol create symbol if needed ( program program , string symbol prefix , address symbol address ) throws invalid input exception { symbol table symbol table = program get symbol table ( ) ; symbol primary symbol = symbol table get primary symbol ( symbol address ) ; if ( primary symbol ! = null & & primary symbol get source ( ) ! = source type default ) { return null ; / / not needed non - default symbol already there } string address appended name = symbol utilities get address appended name ( symbol prefix , symbol address ) ; return symbol table create label ( symbol address , address appended name , source type analysis ) ; }


public static int encode longitude ( double longitude ) { / / the maximum possible value cannot be encoded without overflow if ( longitude = = 180 0d ) { longitude = math next down ( longitude ) ; } return ( int ) math floor ( longitude / lon decode ) ; }


returns the selected files this will show the file chooser

public list < file > get selected files ( ) { show ( ) ; if ( was cancelled ) { return collections empty list ( ) ; } list < file > filtered list = filter files for selection mode ( validated files ) ; return filtered list ; }


process the result of asynchronous calls on success , rc is { @ link keeper exception code # ok } on failure , rc is set to the corresponding failure code in { @ link keeper exception } { @ link keeper exception code # nonode } - the node on given path doesn ' t exist for some api calls

void process result ( int rc , string path , object ctx , byte [ ] data , stat stat ) ;


determine the number of shards with a specific state

public int number of shards with state ( shard routing state states ) { if ( states length = = 1 ) { if ( states [ 0 ] = = shard routing state initializing ) { return initializing shards size ( ) ; } else if ( states [ 0 ] = = shard routing state relocating ) { return relocating shards size ( ) ; } } int count = 0 ; for ( shard routing shard entry : this ) { for ( shard routing state state : states ) { if ( shard entry state ( ) = = state ) { count + + ; } } } return count ; }


decide whether frames should be prepared ahead of time when a frame is drawn

void prepare frames ( bitmap frame preparer bitmap frame preparer , bitmap frame cache bitmap frame cache , animation backend animation backend , int last drawn frame number ) ;


returns the time to wait ( if any ) for the given length message , using the given limit traffic and the max wait time

public long read time to wait ( final long size , final long limit traffic , final long max time , final long now ) { bytes recv flow control ( size ) ; if ( size = = 0 | | limit traffic = = 0 ) { return 0 ; } final long last time check = last time get ( ) ; long sum = current read bytes get ( ) ; long local reading time = reading time ; long last r b = last read bytes ; final long interval = now - last time check ; long past delay = math max ( last reading time - last time check , 0 ) ; if ( interval > abstract traffic shaping handler minimal wait ) { / / enough interval time to compute shaping long time = sum * 1000 / limit traffic - interval + past delay ; if ( time > abstract traffic shaping handler minimal wait ) { if ( logger is debug enabled ( ) ) { logger debug ( " time : " + time + ' : ' + sum + ' : ' + interval + ' : ' + past delay ) ; } if ( time > max time & & now + time - local reading time > max time ) { time = max time ; } reading time = math max ( local reading time , now + time ) ; return time ; } reading time = math max ( local reading time , now ) ; return 0 ; } / / take the last read interval check to get enough interval time long lastsum = sum + last r b ; long lastinterval = interval + check interval get ( ) ; long time = lastsum * 1000 / limit traffic - lastinterval + past delay ; if ( time > abstract traffic shaping handler minimal wait ) { if ( logger is debug enabled ( ) ) { logger debug ( " time : " + time + ' : ' + lastsum + ' : ' + lastinterval + ' : ' + past delay ) ; } if ( time > max time & & now + time - local reading time > max time ) { time = max time ; } reading time = math max ( local reading time , now + time ) ; return time ; } reading time = math max ( local reading time , now ) ; return 0 ; }


public offset date time get ship date ( ) { return ship date ; }


void set home address ( address address ) { instruction inst = program get listing ( ) get instruction at ( address ) ; if ( inst = = null ) { return ; } current addr = inst get min address ( ) ; current fallthrough addr = inst get fall through ( ) ; default fallthrough addr = inst get default fall through ( ) ; is user defined = inst is fall through overridden ( ) ; is default = ! is user defined ; listener state changed ( null ) ; }


merge the differences from the indicated program on the specified address set with the indicated filtering

public boolean merge ( address set view p 1 merge set , program merge filter filter , task monitor monitor ) throws memory access exception , cancelled exception { clear messages ( ) ; merger clear messages ( ) ; merger clear duplicate symbols ( ) ; merger clear duplicate equates ( ) ; address set p 1 code unit set = diff utility get code unit set ( p 1 merge set , this program 1 ) ; if ( monitor = = null ) { / / create a " do nothing " task monitor that we can pass along monitor = task monitor adapter dummy monitor ; } / / check that the needed memory addresses are available in the merge program if ( ! has merge addresses ( p 1 merge set ) ) { error msg append ( " the difference cannot be applied \ n " + " the program does not have memory defined \ n " + " for some of the indicated addresses \ n " ) ; return false ; } / / note : the order in which the following merge methods are called / / is important in some cases for example , calling the / / merge references ( ) before merge labels ( ) would lead to extra / / default labels appearing in the merge program also , you / / want to apply code unit differences before applying / / other merge differences to them merge bytes ( p 1 merge set , filter , monitor ) ; merge program context ( p 1 merge set , filter , monitor ) ; merge code units ( p 1 merge set , filter , monitor ) ; / / code units should follow program context merge comments ( p 1 merge set , filter , monitor ) ; merge functions ( p 1 merge set , filter , monitor ) ; / / functions should follow code units / / note : this should follow code units and functions so that we already / / have a " fun " label since we can ' t create default labels merge labels ( p 1 merge set , filter , monitor ) ; / / labels should follow code units & functions merge references ( p 1 merge set , filter , monitor ) ; / / references should follow labels and code units merge bookmarks ( p 1 merge set , filter , monitor ) ; merge properties ( p 1 merge set , filter , monitor ) ; merge function tags ( p 1 merge set , filter , monitor ) ; merger re apply duplicate equates ( ) ; string dup equates message = merger get duplicate equates info ( ) ; if ( dup equates message length ( ) > 0 ) { info msg append ( dup equates message ) ; } merger re apply duplicate symbols ( ) ; string dup symbols message = merger get duplicate symbols info ( ) ; if ( dup symbols message length ( ) > 0 ) { info msg append ( dup symbols message ) ; } program diff re diff sub set ( p 1 code unit set , monitor ) ; return ( error msg length ( ) = = 0 & & ! merger has error message ( ) ) ; }


set the value of the ' { @ code onkeyup } ' attribute may be a runtime expression

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


tests that label parsing is greedy ( always extracting the longest possible label ) this means that if a label is a substring of another label , it should not be expanded but be treated as part of the longer one

public void test label is substring of valid label ( ) throws exception { setup dummy ( ) ; assert expansion ( " x 3 = foo / bar / x 3 " , " x 3 = bar / x 3 " , immutable map < label , iterable < artifact > > of ( label for ( " bar / x 3 " ) , immutable list of ( artifact for ( " bar / x 3 " ) ) ) ) ; assert expansion ( " foo / x 1 , foo / x 1 1 , foo / xx 1 , foo / xx 1 1 " , " x 1 , x 1 1 , xx 1 , xx 1 1 " , immutable map < label , iterable < artifact > > of ( label for ( " x 1 " ) , immutable list of ( artifact for ( " x 1 " ) ) , label for ( " x 1 1 " ) , immutable list of ( artifact for ( " x 1 1 " ) ) , label for ( " xx 1 " ) , immutable list of ( artifact for ( " xx 1 " ) ) , label for ( " xx 1 1 " ) , immutable list of ( artifact for ( " xx 1 1 " ) ) ) ) ; assert expansion ( " / / x 1 " , " / / x 1 " , immutable map < label , iterable < artifact > > of ( label for ( " x 1 " ) , immutable list of ( artifact for ( " x 1 " ) ) ) ) ; }


public object node detail ( @ request param ( default value = constants default namespace id ) string namespace id , @ request param string service name ) throws nacos exception { service service = service manager get service ( namespace id , service name ) ; if ( service = = null ) { throw new nacos exception ( nacos exception not found , " service " + service name + " is not found ! " ) ; } object node res = jackson utils create empty json node ( ) ; res put ( " name " , naming utils get service name ( service name ) ) ; res put ( " namespace id " , service get namespace id ( ) ) ; res put ( " protect threshold " , service get protect threshold ( ) ) ; res replace ( " metadata " , jackson utils transfer to json node ( service get metadata ( ) ) ) ; res replace ( " selector " , jackson utils transfer to json node ( service get selector ( ) ) ) ; res put ( " group name " , naming utils get group name ( service name ) ) ; array node clusters = jackson utils create empty array node ( ) ; for ( cluster cluster : service get cluster map ( ) values ( ) ) { object node cluster json = jackson utils create empty json node ( ) ; cluster json put ( " name " , cluster get name ( ) ) ; cluster json replace ( " health checker " , jackson utils transfer to json node ( cluster get health checker ( ) ) ) ; cluster json replace ( " metadata " , jackson utils transfer to json node ( cluster get metadata ( ) ) ) ; clusters add ( cluster json ) ; } res replace ( " clusters " , clusters ) ; return res ; }


simply test the reader reads all the splits fine

public void test read ( ) throws exception { try ( source reader < integer , split t > reader = create reader ( ) ) { reader add splits ( get splits ( num splits , num records per split , boundedness bounded ) ) ; validating source output output = new validating source output ( ) ; while ( output count < total num records ) { reader poll next ( output ) ; } output validate ( ) ; } }


plays together all animations passed in as parameter once animation is completed , r run ( ) is executed if parameter is reset is set to true , { @ link # m selected card position } is set to { @ link # invalid card position }

private void start animations ( list < animator > animations , final runnable r , final boolean is reset ) { animator set animator set = new animator set ( ) ; animator set play together ( animations ) ; animator set set duration ( anim duration ) ; animator set set interpolator ( new decelerate interpolator ( deceleration factor ) ) ; animator set add listener ( new animator listener adapter ( ) { @ override public void on animation end ( animator animation ) { if ( r ! = null ) r run ( ) ; set screen touchable ( true ) ; if ( is reset ) m selected card position = invalid card position ; } } ) ; animator set start ( ) ; }


public read only first baz ( string baz ) { this baz = baz ; return this ; }


visit a parse tree produced by the { @ code refcast } labeled alternative in { @ link painless parser # castexpression }

t visit refcast ( painless parser refcast context ctx ) ;


aborts this edit this releases the edit lock so another edit may be started on the same key

public void abort ( ) throws i o exception { complete edit ( this , false ) ; }


reads a quad word from the program ' s memory starting at the indicated address

public static long read q word ( program program , address addr ) throws memory access exception { return program get memory ( ) get long ( addr ) ; }


adds a download defined by the given request

public void add download ( download request request ) { add download ( request , stop reason none ) ; }


public void set ( int n , int start pc , int line number ) { set 0 ( n , new item ( start pc , line number ) ) ; }


specify the { @ link message converter } to use for turning { @ link org springframework remoting support remote invocation } objects into request messages , as well as response messages into { @ link org springframework remoting support remote invocation result } objects default is a { @ link simple message converter } , using a standard jms { @ link javax jms object message } for each invocation invocation result object custom implementations may generally adapt { @ link java io serializable } objects into special kinds of messages , or might be specifically tailored for translating { @ code remote invocation ( result ) s } into specific kinds of messages

public void set message converter ( @ nullable message converter message converter ) { this message converter = ( message converter ! = null ? message converter : new simple message converter ( ) ) ; }


reads the long at the current index and then increments the current index by < code > sizeof long < code >

public long read next long ( long min clamp , long max clamp , long exceptions ) throws i o exception { long l = read long ( current index , min clamp , max clamp , exceptions ) ; current index + = sizeof long ; return l ; }


outputs a reasonably normalized javac option list

public static list < string > normalize options with normalizers ( list < string > javacopts , javac option normalizer normalizers ) { return new javac options ( immutable list copy of ( normalizers ) ) normalize ( javacopts ) ; }


adds an encoding character to the encoded key value string - exact approx version

void metaph add exact approx ( string main exact , string main ) { if ( m encode exact ) { metaph add ( main exact ) ; } else { metaph add ( main ) ; } }


resolve a collection of { @ link com google devtools build lib actions action input } s to { @ link path } s

static collection < path > resolve action inputs ( path exec root , collection < ? extends action input > action inputs ) { return action inputs stream ( ) map ( ( inp ) - > exec root get relative ( inp get exec path ( ) ) ) collect ( immutable list to immutable list ( ) ) ; }


sets custom { @ linkplain executor executor } for tasks of displaying < b > cached on disk < b > images ( these tasks are executed quickly so uil prefer to use separate executor for them ) < br > < br > if you set the same executor for { @ linkplain # task executor ( executor ) general tasks } and tasks about cached images ( this method ) then these tasks will be in the same thread pool so short - lived tasks can wait a long time for their turn < br > < br > < b > note : < b > if you set custom executor then following configuration options will not be considered for this executor : { @ link # thread pool size ( int ) } { @ link # thread priority ( int ) } { @ link # tasks processing order ( queue processing type ) }

public builder task executor for cached images ( executor executor for cached images ) { if ( thread pool size ! = default thread pool size | | thread priority ! = default thread priority | | tasks processing type ! = default task processing type ) { l w ( warning overlap executor ) ; } this task executor for cached images = executor for cached images ; return this ; }


a test for non - trust , non - key configurations these are straight forward and can all be tested together

public void test basic configuration options ( ) { final ssl verification mode verification mode = random from ( ssl verification mode values ( ) ) ; final ssl client authentication mode client auth = random from ( ssl client authentication mode values ( ) ) ; final string [ ] ciphers = generate random string array ( 8 , 12 , false , false ) ; final string [ ] protocols = generate random string array ( 4 , 5 , false , false ) ; settings = settings builder ( ) put ( " test ssl verification mode " , verification mode name ( ) to lower case ( locale root ) ) put ( " test ssl client authentication " , client auth name ( ) to lower case ( locale root ) ) put list ( " test ssl cipher suites " , ciphers ) put list ( " test ssl supported protocols " , protocols ) build ( ) ; final ssl configuration configuration = loader load ( cert root ) ; assert that ( configuration get client auth ( ) , is ( client auth ) ) ; assert that ( configuration get verification mode ( ) , is ( verification mode ) ) ; assert that ( configuration get cipher suites ( ) , equal to ( arrays as list ( ciphers ) ) ) ; assert that ( configuration get supported protocols ( ) , equal to ( arrays as list ( protocols ) ) ) ; if ( verification mode = = ssl verification mode none ) { final ssl trust config trust config = configuration get trust config ( ) ; assert that ( trust config , instance of ( trust everything config class ) ) ; } }


the delta iteration meta operator cannot have broadcast inputs this method always throws an exception

public void set broadcast variable ( string name , operator < ? > root ) { throw new unsupported operation exception ( " the delta iteration meta operator cannot have broadcast inputs " ) ; }


userlist assumes one user per line each line in users - list - file is of the form & lt ; username & gt ; [ , group ] < br > group names are ignored ( they are not parsed at all )

private list < user group information > parse user list ( uri user uri , configuration conf ) throws i o exception { if ( null = = user uri ) { return collections empty list ( ) ; } final path userloc = new path ( user uri to string ( ) ) ; final text raw ugi = new text ( ) ; final file system fs = userloc get file system ( conf ) ; final array list < user group information > ugi list = new array list < user group information > ( ) ; line reader in = null ; try { in = new line reader ( fs open ( userloc ) ) ; while ( in read line ( raw ugi ) > 0 ) { / / line is of the form username [ , group ] * if ( raw ugi to string ( ) trim ( ) equals ( " " ) ) { continue ; / / continue on empty line } / / e is end position of user name in this line int e = raw ugi find ( " , " ) ; if ( e = = 0 ) { throw new i o exception ( " missing username : " + raw ugi ) ; } if ( e = = - 1 ) { e = raw ugi get length ( ) ; } final string username = text decode ( raw ugi get bytes ( ) , 0 , e ) trim ( ) ; user group information ugi = null ; try { ugi = user group information create proxy user ( username , user group information get login user ( ) ) ; } catch ( i o exception ioe ) { log error ( " error while creating a proxy user " , ioe ) ; } if ( ugi ! = null ) { ugi list add ( ugi ) ; } / / no need to parse groups , even if they exist go to next line } } finally { if ( in ! = null ) { in close ( ) ; } } return ugi list ; }


returns a string representation of this array in the same form as { @ link arrays # to string ( int [ ] ) } , for example { @ code " [ 1 , 2 , 3 ] " }

public string to string ( ) { if ( is empty ( ) ) { return " [ ] " ; } string builder builder = new string builder ( length ( ) * 5 ) ; / / rough estimate is fine builder append ( ' [ ' ) append ( array [ start ] ) ; for ( int i = start + 1 ; i < end ; i + + ) { builder append ( " , " ) append ( array [ i ] ) ; } builder append ( ' ] ' ) ; return builder to string ( ) ; }


protected void prepare consentable attributes ( final map < string , list < object > > attributes , final request context context ) { val builders = new array list < > ( application context get beans of type ( consentable attribute builder class , false , true ) values ( ) ) ; annotation aware order comparator sort if necessary ( builders ) ; val consentable attributes = new array list < cas consentable attribute > ( ) ; attributes for each ( ( key , value ) - > { var attr = cas consentable attribute builder ( ) name ( key ) values ( value ) build ( ) ; for ( val builder : builders ) { logger trace ( " preparing to build consentable attribute [ { } ] via [ { } ] " , attr , builder get name ( ) ) ; attr = builder build ( attr ) ; logger trace ( " finalized consentable attribute [ { } ] " , attr ) ; } consentable attributes add ( attr ) ; } ) ; context get flow scope ( ) put ( " attributes " , consentable attributes ) ; }


default collection < single logout url > determine logout url ( final registered service registered service , final web application service single logout service ) { return determine logout url ( registered service , single logout service , optional empty ( ) ) ; }


removes the working panel and any buttons on the gui

private void remove existing gui components ( ) { remove work panel ( ) ; if ( apply button ! = null ) { remove button ( apply button ) ; } if ( cancel button ! = null ) { remove button ( cancel button ) ; } if ( search all button ! = null ) { remove button ( search all button ) ; } }


checks the wrapped analyzer for the provided restricted { @ link analysis mode } and throws an error if the analyzer is not allowed to run in that mode the error contains more detailed information about the offending filters that caused the analyzer to not be allowed in this mode

public void check allowed in mode ( analysis mode mode ) { objects require non null ( mode ) ; if ( this get analysis mode ( ) = = analysis mode all ) { return ; / / everything allowed if this analyzer is in all mode } if ( this get analysis mode ( ) ! = mode ) { if ( analyzer instanceof analyzer components provider ) { token filter factory [ ] token filters = ( ( analyzer components provider ) analyzer ) get components ( ) get token filters ( ) ; list < string > offending filters = new array list < > ( ) ; for ( token filter factory token filter : token filters ) { analysis mode filter mode = token filter get analysis mode ( ) ; if ( filter mode ! = analysis mode all & & filter mode ! = mode ) { offending filters add ( token filter name ( ) ) ; } } throw new mapper exception ( " analyzer [ " + name + " ] contains filters " + offending filters + " that are not allowed to run in " + mode get readable name ( ) + " mode " ) ; } else { throw new mapper exception ( " analyzer [ " + name + " ] contains components that are not allowed to run in " + mode get readable name ( ) + " mode " ) ; } } }


returns a list of all discovered { @ link attributed graph exporter }

public list < attributed graph exporter > get graph exporters ( ) ;


a very specific method that will : make sure the html length is clipped to a reasonable size < b > escape any embedded html < b > ( so that it is not interpreted as html ) put the entire result in html

public static string to literal h t m l for tooltip ( string text ) { if ( text length ( ) > max tooltip length ) { text = text substring ( 0 , max tooltip length ) + " " ; } string html = to h t m l with line wrapping and encoding ( text , default tooltip max line length , false ) ; return html ; }


gets the type to assign to a token created by the lexer

public int get type ( ) { return type ; }


associates the given object with the given range of addresses

public void add object ( object obj , address start addr , address end addr ) { long start = addr map get key ( start addr ) ; long end = addr map get key ( end addr ) ; add range ( obj , start , end ) ; coalesce range ( start , end ) ; }


look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type

public value holder get argument value ( int index , class < ? > required type , string required name ) { return get argument value ( index , required type , required name , null ) ; }


tests whether mtab parsing works as expected with the specified hierarchy

public void test remount ( ) throws exception { / / initialize mount point file parent dir = new file ( tmp path ) ; final string old mount point dir = " oldmount " ; final string new mount point dir = " newmount " ; file old mount point = new file ( parent dir , old mount point dir ) ; file mtab = create premounted cgroups ( old mount point , true ) ; file new mount point = new file ( parent dir , new mount point dir ) ; assert true ( " could not create dirs " , new file ( new mount point , " cpu " ) mkdirs ( ) ) ; / / initialize yarn classes configuration conf mount = create mount configuration ( ) ; conf mount set ( yarn configuration nm linux container cgroups mount path , parent dir get absolute path ( ) + path separator + new mount point dir ) ; c groups handler impl c groups handler = new c groups handler impl ( conf mount , privileged operation executor mock , mtab get absolute path ( ) ) ; c groups handler initialize c group controller ( c groups handler c group controller cpu ) ; argument captor < privileged operation > op captor = argument captor for class ( privileged operation class ) ; verify ( privileged operation executor mock ) execute privileged operation ( op captor capture ( ) , eq ( false ) ) ; file hierarchy file = new file ( new file ( new mount point , " cpu " ) , this hierarchy ) ; assert true ( " yarn cgroup should exist " , hierarchy file exists ( ) ) ; }


public static void skip ( data input stream in ) throws i o exception { byte [ ] preamble = new byte [ preamble length ] ; in read fully ( preamble ) ; if ( ! arrays equals ( preamble , preamble ) ) return ; / / not a valid preamble data input stream decoded = new data input stream ( base 6 4 get decoder ( ) wrap ( in ) ) ; int mac sz = - decoded read int ( ) ; if ( mac sz > 0 ) { / / new format i o utils skip ( decoded , mac sz ) ; int sz = decoded read int ( ) ; i o utils skip ( decoded , sz ) ; } else { / / old format int sz = - mac sz ; i o utils skip ( decoded , sz ) ; } byte [ ] postamble = new byte [ postamble length ] ; in read fully ( postamble ) ; }


finds pets by status multiple status values can be provided with comma separated strings

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


{ @ inherit doc } the default implementation does nothing

@ override public void exit query specification ( sql base parser query specification context ctx ) { }


gets any warning messages associated with the initial diff of the two programs

public string get warnings ( ) { return merge engine get warnings ( ) ; }


standard quick sort except that sorting is done on an index array rather than the values themselves

private static void quick sort ( int [ ] order , double [ ] values , int start , int end , int limit ) { / / the while loop implements tail - recursion to avoid excessive stack calls on nasty cases while ( end - start > limit ) { / / pivot by a random element int pivot index = start + prng next int ( end - start ) ; double pivot value = values [ order [ pivot index ] ] ; / / move pivot to beginning of array swap ( order , start , pivot index ) ; / / we use a three way partition because many duplicate values is an important case int low = start + 1 ; / / low points to first value not known to be equal to pivot value int high = end ; / / high points to first value > pivot value int i = low ; / / i scans the array while ( i < high ) { / / invariant : values [ order [ k ] ] = = pivot value for k in [ 0 low ) / / invariant : values [ order [ k ] ] < pivot value for k in [ low i ) / / invariant : values [ order [ k ] ] > pivot value for k in [ high end ) / / in - loop : i < high / / in - loop : low < high / / in - loop : i > = low double vi = values [ order [ i ] ] ; if ( vi = = pivot value ) { if ( low ! = i ) { swap ( order , low , i ) ; } else { i + + ; } low + + ; } else if ( vi > pivot value ) { high - - ; swap ( order , i , high ) ; } else { / / vi < pivot value i + + ; } } / / invariant : values [ order [ k ] ] = = pivot value for k in [ 0 low ) / / invariant : values [ order [ k ] ] < pivot value for k in [ low i ) / / invariant : values [ order [ k ] ] > pivot value for k in [ high end ) / / assert i = = high | | low = = high therefore , we are done with partition / / at this point , i = = high , from [ start , low ) are = = pivot , [ low , high ) are < and [ high , end ) are > / / we have to move the values equal to the pivot into the middle to do this , we swap pivot / / values into the top end of the [ low , high ) range stopping when we run out of destinations / / or when we run out of values to copy int from = start ; int to = high - 1 ; for ( i = 0 ; from < low & & to > = low ; i + + ) { swap ( order , from + + , to - - ) ; } if ( from = = low ) { / / ran out of things to copy this means that the the last destination is the boundary low = to + 1 ; } else { / / ran out of places to copy to this means that there are uncopied pivots and the / / boundary is at the beginning of those low = from ; } / / now recurse , but arrange it so we handle the longer limit by tail recursion if ( low - start < end - high ) { quick sort ( order , values , start , low , limit ) ; / / this is really a way to do / / quick sort ( order , values , high , end , limit ) ; start = high ; } else { quick sort ( order , values , high , end , limit ) ; / / this is really a way to do / / quick sort ( order , values , start , low , limit ) ; end = low ; } } }


updated user this can only be done by the logged in user

public void update user ( string username , user body ) { / / todo : implement }


resolve the exception by iterating over the list of configured exception resolvers the first one to return a { @ link model and view } wins otherwise { @ code null } is returned

public model and view resolve exception ( http servlet request request , http servlet response response , @ nullable object handler , exception ex ) { if ( this resolvers ! = null ) { for ( handler exception resolver handler exception resolver : this resolvers ) { model and view mav = handler exception resolver resolve exception ( request , response , handler , ex ) ; if ( mav ! = null ) { return mav ; } } } return null ; }


return the minimum count of documents that buckets need to have in order to be included in the response

public long min doc count ( ) { return min doc count ; }


returns whether or not to strip the binaries

public boolean should strip binaries ( ) { return strip binaries ; }


private static string generate operation name ( url service u r i , request request ) { return new string builder ( service u r i get path ( ) ) append ( " " ) append ( request get method name ( ) ) append ( " ( " ) append ( request get paramters desc ( ) ) append ( " ) " ) to string ( ) ; }


public void test json form data ( string param , string param 2 ) throws api exception { object local var post body = null ; / / verify the required parameter ' param ' is set if ( param = = null ) { throw new api exception ( 400 , " missing the required parameter ' param ' when calling test json form data " ) ; } / / verify the required parameter ' param 2 ' is set if ( param 2 = = null ) { throw new api exception ( 400 , " missing the required parameter ' param 2 ' when calling test json form data " ) ; } / / create path and map variables string local var path = " / fake / json form data " replace all ( " \ \ { format \ \ } " , " json " ) ; / / query params list < pair > local var query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; if ( param ! = null ) local var form params put ( " param " , param ) ; if ( param 2 ! = null ) local var form params put ( " param 2 " , param 2 ) ; final string [ ] local var accepts = { } ; final string local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { " application / x - www - form - urlencoded " } ; final string local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { } ; api client invoke a p i ( local var path , " get " , local var query params , local var post body , local var header params , local var cookie params , local var form params , local var accept , local var content type , local var auth names , null ) ; }


create the actual resource inside the application submission context info to be submitted to the rm from the information provided by the user

private static resource create app submission context resource ( application submission context info new app , configuration conf ) throws bad request exception { if ( new app get resource ( ) getv cores ( ) > conf get int ( yarn configuration rm scheduler maximum allocation vcores , yarn configuration default rm scheduler maximum allocation vcores ) ) { string msg = " requested more cores than configured max " ; throw new bad request exception ( msg ) ; } if ( new app get resource ( ) get memory size ( ) > conf get int ( yarn configuration rm scheduler maximum allocation mb , yarn configuration default rm scheduler maximum allocation mb ) ) { string msg = " requested more memory than configured max " ; throw new bad request exception ( msg ) ; } resource r = resource new instance ( new app get resource ( ) get memory size ( ) , new app get resource ( ) getv cores ( ) ) ; return r ; }


returns the { @ link socks cmd status } of this { @ link socks cmd response }

public socks cmd status cmd status ( ) { return cmd status ; }


public proxy set no proxy ( string no proxy ) { verify proxy type compatibility ( proxy type manual ) ; this proxy type = proxy type manual ; this no proxy = no proxy ; return this ; }


returns a random source in a given x content type containing a random number of fields , objects and array , with maximum depth 5 the minimum number of fields per object is provided as an argument

public static bytes reference random source ( random random , x content type x content type , int min num fields ) { try ( x content builder builder = x content factory content builder ( x content type ) ) { builder start object ( ) ; add fields ( random , builder , min num fields , 0 ) ; builder end object ( ) ; return bytes reference bytes ( builder ) ; } catch ( i o exception e ) { throw new runtime exception ( e ) ; } }


resolves the script source from either the ' { @ code script - source } ' attribute or the ' { @ code inline - script } ' element logs and { @ link xml reader context # error } and returns { @ code null } if neither or both of these values are specified

private string resolve script source ( element element , xml reader context reader context ) { boolean has script source = element has attribute ( script source attribute ) ; list < element > elements = dom utils get child elements by tag name ( element , inline script element ) ; if ( has script source & & ! elements is empty ( ) ) { reader context error ( " only one of ' script - source ' and ' inline - script ' should be specified " , element ) ; return null ; } else if ( has script source ) { return element get attribute ( script source attribute ) ; } else if ( ! elements is empty ( ) ) { element inline element = elements get ( 0 ) ; return " inline : " + dom utils get text value ( inline element ) ; } else { reader context error ( " must specify either ' script - source ' or ' inline - script ' " , element ) ; return null ; } }


returns set of non - configurable attribute names defined for this class of rule

public list < string > get non configurable attributes ( ) { return non configurable attributes ; }


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

public boolean is disabled ( ) { return this disabled ; }


tests safemode with view f s overload scheme , but with wrong target fs

public void test safe mode with wrong f s ( ) throws exception { final path hdfs target path = new path ( " hdfs : / / non existent " + hdfs user folder ) ; add mount links ( default f s u r i get host ( ) , new string [ ] { hdfs user folder } , new string [ ] { hdfs target path to uri ( ) to string ( ) } , conf ) ; final d f s admin dfs admin = new d f s admin ( conf ) ; redirect stream ( ) ; int ret = tool runner run ( dfs admin , new string [ ] { " - safemode " , " enter " } ) ; assert equals ( - 1 , ret ) ; assert err msg ( " safemode : java net unknown host exception : non existent " , 0 ) ; }


register all relevant annotation post processors in the given registry

public static set < bean definition holder > register annotation config processors ( bean definition registry registry , @ nullable object source ) { default listable bean factory bean factory = unwrap default listable bean factory ( registry ) ; if ( bean factory ! = null ) { if ( ! ( bean factory get dependency comparator ( ) instanceof annotation aware order comparator ) ) { bean factory set dependency comparator ( annotation aware order comparator instance ) ; } if ( ! ( bean factory get autowire candidate resolver ( ) instanceof context annotation autowire candidate resolver ) ) { bean factory set autowire candidate resolver ( new context annotation autowire candidate resolver ( ) ) ; } } set < bean definition holder > bean defs = new linked hash set < > ( 8 ) ; if ( ! registry contains bean definition ( configuration annotation processor bean name ) ) { root bean definition def = new root bean definition ( configuration class post processor class ) ; def set source ( source ) ; bean defs add ( register post processor ( registry , def , configuration annotation processor bean name ) ) ; } if ( ! registry contains bean definition ( autowired annotation processor bean name ) ) { root bean definition def = new root bean definition ( autowired annotation bean post processor class ) ; def set source ( source ) ; bean defs add ( register post processor ( registry , def , autowired annotation processor bean name ) ) ; } / / check for jsr - 250 support , and if present add the common annotation bean post processor if ( jsr 2 5 0 present & & ! registry contains bean definition ( common annotation processor bean name ) ) { root bean definition def = new root bean definition ( common annotation bean post processor class ) ; def set source ( source ) ; bean defs add ( register post processor ( registry , def , common annotation processor bean name ) ) ; } / / check for jpa support , and if present add the persistence annotation bean post processor if ( jpa present & & ! registry contains bean definition ( persistence annotation processor bean name ) ) { root bean definition def = new root bean definition ( ) ; try { def set bean class ( class utils for name ( persistence annotation processor class name , annotation config utils class get class loader ( ) ) ) ; } catch ( class not found exception ex ) { throw new illegal state exception ( " cannot load optional framework class : " + persistence annotation processor class name , ex ) ; } def set source ( source ) ; bean defs add ( register post processor ( registry , def , persistence annotation processor bean name ) ) ; } if ( ! registry contains bean definition ( event listener processor bean name ) ) { root bean definition def = new root bean definition ( event listener method processor class ) ; def set source ( source ) ; bean defs add ( register post processor ( registry , def , event listener processor bean name ) ) ; } if ( ! registry contains bean definition ( event listener factory bean name ) ) { root bean definition def = new root bean definition ( default event listener factory class ) ; def set source ( source ) ; bean defs add ( register post processor ( registry , def , event listener factory bean name ) ) ; } return bean defs ; }


override the default { @ link time zone } to use for formatting default value used is utc ( not local timezone )

public jackson 2 object mapper builder time zone ( time zone time zone ) { this time zone = time zone ; return this ; }


synchronized protected i o exception get ( ) { return thrown ; }


transform the value of each input record into a new value ( with possible new type ) of the output record the provided { @ link value mapper } is applied to each input record value and computes a new value for it thus , an input record { @ code < k , v > } can be transformed into an output record { @ code < k : v ' > } this is a stateless record - by - record operation ( cf { @ link # transform values ( value transformer supplier , string ) } for stateful value transformation ) the example below counts the number of token of the value string { @ code k stream < string , string > input stream = builder stream ( " topic " ) ; k stream < string , integer > output stream = input stream map values ( new value mapper < string , integer > { integer apply ( string value ) { return value split ( " " ) length ; } } ) ; } setting a new value preserves data co - location with respect to the key thus , no internal data redistribution is required if a key based operator ( like an aggregation or join ) is applied to the result { @ code k stream } ( cf { @ link # map ( key value mapper ) } )

< vr > k stream < k , vr > map values ( final value mapper < ? super v , ? extends vr > mapper , final named named ) ;


returns media period based on the provided filterable manifest

media period create media period ( t manifest , int period index ) ;


private void add target ( transitive info collection dep ) { for ( artifact artifact : file type filter list ( dep get provider ( file provider class ) get files to build ( ) to list ( ) , cpp file types shared library ) ) { builder add ( library to link builder ( ) set library identifier ( cc linking outputs library identifier of ( artifact ) ) set dynamic library ( artifact ) build ( ) ) ; } }


public void test char array merger ( ) { char [ ] array one = " hello " to char array ( ) ; char [ ] array two = " world " to char array ( ) ; char [ ] result = merger factory get merger ( char [ ] class ) merge ( array one , array two , null ) ; assertions assert equals ( 10 , result length ) ; char [ ] merged result = " helloworld " to char array ( ) ; for ( int i = 0 ; i < merged result length ; i + + ) { assertions assert equals ( merged result [ i ] , result [ i ] ) ; } result = merger factory get merger ( char [ ] class ) merge ( null ) ; assertions assert equals ( 0 , result length ) ; result = merger factory get merger ( char [ ] class ) merge ( null , null ) ; assertions assert equals ( 0 , result length ) ; }


public static < k1 , v1 , k2 , v2 > class < mapper < k1 , v1 , k2 , v2 > > get mapper class ( job context job ) { return ( class < mapper < k1 , v1 , k2 , v2 > > ) job get configuration ( ) get class ( map class , mapper class ) ; }


private static < k , v > red black entry node color color of ( red black entry < k , v > p ) { return ( p = = null ? black : p color ) ; }


if failed then there was an error parsing the results that cannot be recovered from

public boolean is failed ( ) { return failed ; }


the { @ link reservation list request } will use the reservation id to search for reservations to list if it is provided otherwise , it will select active reservations within the start time and end time ( inclusive )

public static reservation list request new instance ( string queue , string reservation id ) { return new instance ( queue , reservation id , - 1 , - 1 , false ) ; }


returns a quoted version of the given string , if necessary

private static string quoted string ( string string ) { return string length ( ) = = 0 | | string index of ( ' ' ) > = 0 | | string index of ( ' @ ' ) > = 0 | | string index of ( ' { ' ) > = 0 | | string index of ( ' } ' ) > = 0 | | string index of ( ' ( ' ) > = 0 | | string index of ( ' ) ' ) > = 0 | | string index of ( ' : ' ) > = 0 | | string index of ( ' ; ' ) > = 0 | | string index of ( ' , ' ) > = 0 ? ( " ' " + string + " ' " ) : ( string ) ; }


scheduled future < ? > schedule ( channel handler context ctx , runnable task , long delay , time unit unit ) { return ctx executor ( ) schedule ( task , delay , unit ) ; }


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


write a line of text to a file characters are encoded into bytes using utf - 8 this utility method opens the file for writing , creating the file if it does not exist , or overwrites an existing file

public static file system write ( final file system fs , final path path , final char sequence charseq ) throws i o exception { return write ( fs , path , charseq , standard charsets utf 8 ) ; }


this is to be called when node manager reconnects or goes down this will remove if n m tokens if present for any running application from cache

public void remove node key ( node id node id ) { this write lock lock ( ) ; try { iterator < hash set < node id > > app node key set iterator = this app attempt to node key map values ( ) iterator ( ) ; while ( app node key set iterator has next ( ) ) { app node key set iterator next ( ) remove ( node id ) ; } } finally { this write lock unlock ( ) ; } }


returns the nodes which have an incident edge in common with { @ code node } in this graph this is equal to the union of { @ link # predecessors ( object ) } and { @ link # successors ( object ) }


executes the given runnable using the execution context ' s classloader as thread classloader

void wrap class loader ( runnable runnable ) { try ( temporary class loader context ignored = temporary class loader context of ( class loader ) ) { runnable run ( ) ; } }


resets variables maintaining the sum to zero this method may be a useful alternative to creating a new adder , but is only effective if there are no concurrent updates because this method is intrinsically racy , it should only be used when it is known that no threads are concurrently updating

public void reset ( ) { internal reset ( 0l ) ; }


return whether the scanner has been started

boolean get run status ( ) { return should run get ( ) ; }


perform spring - based scanning for entity classes , registering them as annotated classes with this { @ code configuration }

public local session factory builder scan packages ( string packages to scan ) throws hibernate exception { set < string > entity class names = new tree set < > ( ) ; set < string > converter class names = new tree set < > ( ) ; set < string > package names = new tree set < > ( ) ; try { for ( string pkg : packages to scan ) { string pattern = resource pattern resolver classpath all url prefix + class utils convert class name to resource path ( pkg ) + resource pattern ; resource [ ] resources = this resource pattern resolver get resources ( pattern ) ; metadata reader factory reader factory = new caching metadata reader factory ( this resource pattern resolver ) ; for ( resource resource : resources ) { if ( resource is readable ( ) ) { metadata reader reader = reader factory get metadata reader ( resource ) ; string class name = reader get class metadata ( ) get class name ( ) ; if ( matches entity type filter ( reader , reader factory ) ) { entity class names add ( class name ) ; } else if ( converter type filter match ( reader , reader factory ) ) { converter class names add ( class name ) ; } else if ( class name ends with ( package info suffix ) ) { package names add ( class name substring ( 0 , class name length ( ) - package info suffix length ( ) ) ) ; } } } } } catch ( i o exception ex ) { throw new mapping exception ( " failed to scan classpath for unlisted classes " , ex ) ; } try { class loader cl = this resource pattern resolver get class loader ( ) ; for ( string class name : entity class names ) { add annotated class ( class utils for name ( class name , cl ) ) ; } for ( string class name : converter class names ) { add attribute converter ( ( class < ? extends attribute converter < ? , ? > > ) class utils for name ( class name , cl ) ) ; } for ( string package name : package names ) { add package ( package name ) ; } } catch ( class not found exception ex ) { throw new mapping exception ( " failed to load annotated classes from classpath " , ex ) ; } return this ; }


returns some statistics about the watches loaded in the trigger service

public counters stats ( ) { counters counters = new counters ( ) ; / / for bwc reasons , active / total contain the same values int watch count = per watch stats size ( ) ; counters inc ( " count active " , watch count ) ; counters inc ( " count total " , watch count ) ; counters inc ( " watch trigger all active " , watch count ) ; counters inc ( " watch trigger all total " , watch count ) ; counters inc ( " watch input all total " , watch count ) ; counters inc ( " watch input all active " , watch count ) ; per watch stats values ( ) for each ( stats - > { if ( stats metadata ) { counters inc ( " watch metadata active " ) ; counters inc ( " watch metadata total " ) ; } counters inc ( " watch trigger " + stats trigger type + " total " ) ; counters inc ( " watch trigger " + stats trigger type + " active " ) ; if ( strings is null or empty ( stats schedule type ) = = false ) { counters inc ( " watch trigger schedule " + stats schedule type + " total " ) ; counters inc ( " watch trigger schedule " + stats schedule type + " active " ) ; counters inc ( " watch trigger schedule all total " ) ; counters inc ( " watch trigger schedule all active " ) ; } counters inc ( " watch input " + stats input type + " active " ) ; counters inc ( " watch input " + stats input type + " total " ) ; counters inc ( " watch condition " + stats condition type + " active " ) ; counters inc ( " watch condition " + stats condition type + " total " ) ; counters inc ( " watch condition all total " ) ; counters inc ( " watch condition all active " ) ; if ( strings is null or empty ( stats transform type ) = = false ) { counters inc ( " watch transform " + stats transform type + " active " ) ; counters inc ( " watch transform " + stats transform type + " total " ) ; counters inc ( " watch transform all active " ) ; counters inc ( " watch transform all total " ) ; } for ( trigger watch stats action stats action : stats actions ) { counters inc ( " watch action " + action action type + " active " ) ; counters inc ( " watch action " + action action type + " total " ) ; counters inc ( " watch action all active " ) ; counters inc ( " watch action all total " ) ; if ( strings is null or empty ( action condition type ) = = false ) { counters inc ( " watch action condition " + action condition type + " active " ) ; counters inc ( " watch action condition " + action condition type + " total " ) ; counters inc ( " watch action condition all active " ) ; counters inc ( " watch action condition all total " ) ; } if ( strings is null or empty ( action transform type ) = = false ) { counters inc ( " watch action transform " + action transform type + " active " ) ; counters inc ( " watch action transform " + action transform type + " total " ) ; counters inc ( " watch action transform all active " ) ; counters inc ( " watch action transform all total " ) ; } } } ) ; return counters ; }


use this to initialize an encrypted s q l cipher database

public database get encrypted readable db ( char [ ] password ) { encrypted helper encrypted helper = check encrypted helper ( ) ; return encrypted helper get encrypted readable db ( password ) ; }


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


add a declared parameter to the list of parameters for the call only parameters declared as { @ code sql parameter } and { @ code sql in out parameter } will be used to provide input values this is different from the { @ code stored procedure } class which - for backwards compatibility reasons - allows input values to be provided for parameters declared as { @ code sql out parameter }

public void add declared parameter ( sql parameter parameter ) { assert not null ( parameter , " the supplied parameter must not be null " ) ; if ( ! string utils has text ( parameter get name ( ) ) ) { throw new invalid data access api usage exception ( " you must specify a parameter name when declaring parameters for \ " " + get procedure name ( ) + " \ " " ) ; } this declared parameters add ( parameter ) ; if ( logger is debug enabled ( ) ) { logger debug ( " added declared parameter for [ " + get procedure name ( ) + " ] : " + parameter get name ( ) ) ; } }


starts the event processors and returns the fully configured ring buffer the ring buffer is set up to prevent overwriting any entry that is yet to be processed by the slowest event processor this method must only be called once after all event processors have been added

public ring buffer < t > start ( ) { check only started once ( ) ; for ( final consumer info consumer info : consumer repository ) { consumer info start ( executor ) ; } return ring buffer ; }


format url template using given variables

public string url ( map < string , string > variables ) { string url = this url ; / / go through variables and replace placeholders for ( map entry < string , server variable > variable : this variables entry set ( ) ) { string name = variable get key ( ) ; server variable server variable = variable get value ( ) ; string value = server variable default value ; if ( variables ! = null & & variables contains key ( name ) ) { value = variables get ( name ) ; if ( server variable enum values size ( ) > 0 & & ! server variable enum values contains ( value ) ) { throw new runtime exception ( " the variable " + name + " in the server url has invalid value " + value + " " ) ; } } url = url replace all ( " \ \ { " + name + " \ \ } " , value ) ; } return url ; }


returns the set of { @ link constraint setting info settings } where this { @ link constraint collection } and { @ code other } have different { @ link constraint value info values }

public immutable set < constraint setting info > diff ( constraint collection other ) { immutable set < constraint setting info > constraints to check = new immutable set builder < constraint setting info > ( ) add all ( this constraint settings ( ) ) add all ( other constraint settings ( ) ) build ( ) ; immutable set builder < constraint setting info > mismatch settings = new immutable set builder < > ( ) ; for ( constraint setting info constraint setting : constraints to check ) { constraint value info this constraint = this get ( constraint setting ) ; constraint value info other constraint = other get ( constraint setting ) ; if ( this constraint ! = null & & ! this constraint equals ( other constraint ) ) { mismatch settings add ( constraint setting ) ; } } return mismatch settings build ( ) ; }


register a listener that will be called when this model visibility has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public abstract epoxy model with view on visibility changed ( on model visibility changed listener < abstract epoxy model with view , view > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


creates a new big - endian buffer whose content is a subregion of the specified { @ code array } encoded in the specified { @ code charset } the new buffer ' s { @ code reader index } and { @ code writer index } are { @ code 0 } and the length of the encoded string respectively

public static byte buf copied buffer ( char [ ] array , int offset , int length , charset charset ) { object util check not null ( array , " array " ) ; if ( length = = 0 ) { return empty buffer ; } return copied buffer ( char buffer wrap ( array , offset , length ) , charset ) ; }


void register and connect ( socket channel sock , inet socket address addr ) throws i o exception { sock key = sock register ( selector , selection key op connect ) ; boolean immediate connect = sock connect ( addr ) ; if ( immediate connect ) { send thread prime connection ( ) ; } }


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


returns true if the compilation unit contains a single top - level class generated by an exempt annotation processor ( according to its { @ link @ generated } annotation ) annotation processors are expected to never generate more than one top level class , as required by the style guide

public boolean is annotation processor exempt ( j c tree j c compilation unit unit ) { if ( unit get type decls ( ) size ( ) ! = 1 ) { return false ; } symbol sym = tree info symbol for ( get only element ( unit get type decls ( ) ) ) ; if ( sym = = null ) { return false ; } for ( string value : get generated by ( sym ) ) { if ( dependency module get exempt generators ( ) contains ( value ) ) { return true ; } } return false ; }


get the total number of bytes read on erasure - coded files

public long get bytes read erasure coded ( ) { return visit all ( new statistics aggregator < long > ( ) { private long bytes read erasure coded = 0 ; @ override public void accept ( statistics data data ) { bytes read erasure coded + = data bytes read erasure coded ; } public long aggregate ( ) { return bytes read erasure coded ; } } ) ; }


private void repartition split state ( map < string , list < tuple 2 < stream state handle , operator state handle state meta info > > > name to distribute state , int new parallelism , list < map < stream state handle , operator state handle > > merge map list ) { int start parallel op = 0 ; / / iterate all named states and repartition one named state at a time per iteration for ( map entry < string , list < tuple 2 < stream state handle , operator state handle state meta info > > > e : name to distribute state entry set ( ) ) { list < tuple 2 < stream state handle , operator state handle state meta info > > current = e get value ( ) ; / / determine actual number of partitions for this named state int total partitions = 0 ; for ( tuple 2 < stream state handle , operator state handle state meta info > offsets : current ) { total partitions + = offsets f 1 get offsets ( ) length ; } / / repartition the state across the parallel operator instances int lst idx = 0 ; int offset idx = 0 ; int base fraction = total partitions / new parallelism ; int remainder = total partitions % new parallelism ; int new start parallel op = start parallel op ; for ( int i = 0 ; i < new parallelism ; + + i ) { / / preparation : calculate the actual index considering wrap around int parallel op idx = ( i + start parallel op ) % new parallelism ; / / now calculate the number of partitions we will assign to the parallel instance in / / this round int number of partitions to assign = base fraction ; / / and distribute odd partitions while we still have some , one at a time if ( remainder > 0 ) { + + number of partitions to assign ; - - remainder ; } else if ( remainder = = 0 ) { / / we are out of odd partitions now and begin our next redistribution round with / / the current / / parallel operator to ensure fair load balance new start parallel op = parallel op idx ; - - remainder ; } / / now start collection the partitions for the parallel instance into this list while ( number of partitions to assign > 0 ) { tuple 2 < stream state handle , operator state handle state meta info > handle with offsets = current get ( lst idx ) ; long [ ] offsets = handle with offsets f 1 get offsets ( ) ; int remaining = offsets length - offset idx ; / / repartition offsets long [ ] offs ; if ( remaining > number of partitions to assign ) { offs = arrays copy of range ( offsets , offset idx , offset idx + number of partitions to assign ) ; offset idx + = number of partitions to assign ; } else { if ( optimize memory use ) { handle with offsets f 1 = null ; / / gc } offs = arrays copy of range ( offsets , offset idx , offsets length ) ; offset idx = 0 ; + + lst idx ; } number of partitions to assign - = remaining ; / / as a last step we merge partitions that use the same stream state handle in a / / single / / operator state handle map < stream state handle , operator state handle > merge map = merge map list get ( parallel op idx ) ; operator state handle operator state handle = merge map get ( handle with offsets f 0 ) ; if ( operator state handle = = null ) { operator state handle = new operator stream state handle ( new hash map < > ( name to distribute state size ( ) ) , handle with offsets f 0 ) ; merge map put ( handle with offsets f 0 , operator state handle ) ; } operator state handle get state name to partition offsets ( ) put ( e get key ( ) , new operator state handle state meta info ( offs , operator state handle mode split distribute ) ) ; } } start parallel op = new start parallel op ; e set value ( null ) ; } }


protected void serialize ( data tree dt , map < long , integer > sessions , output archive oa , file header header ) throws i o exception { / / this is really a programmatic error and not something that can / / happen at runtime if ( header = = null ) { throw new illegal state exception ( " snapshot ' s not open for writing : uninitialized header " ) ; } header serialize ( oa , " fileheader " ) ; serialize utils serialize snapshot ( dt , oa , sessions ) ; }


installs and returns the defaults for dark lafs

public u i defaults get defaults ( ) { final u i defaults defaults = super get defaults ( ) ; m t laf installer install defaults ( defaults ) ; / / install darcula defaults install darcula defaults ( defaults ) ; / / install material defaults m t laf installer install m t defaults ( defaults ) ; return defaults ; } @ suppress warnings ( { " method with multiple loops " , " overly complex method " , " magic character " }


rejects the timestamp last polled in { @ link # maybe poll timestamp ( long ) } the instance will enter the error state and poll timestamps infrequently until the next call to { @ link # accept timestamp ( ) }

public void reject timestamp ( ) { update state ( state error ) ; }


public void set heuristic cpu cost ( double cost ) { if ( cost < = 0 ) { throw new illegal argument exception ( " heuristic costs must be positive " ) ; } this heuristic cpu cost = cost ; }


lookup ganglia conf from cache if not found , return default values

protected ganglia conf get ganglia conf for metric ( string metric name ) { ganglia conf gconf = ganglia conf map get ( metric name ) ; return gconf ! = null ? gconf : default ganglia conf ; }


define default request properties that should be merged into all performed requests such that input from the client request override the default properties defined here this is delegated to { @ link configurable mock mvc builder # default request ( request builder ) }

< t extends b > t default request ( request builder request builder ) ;


returns a string such that all uppercase characters in the given string are replaced by the mangle char followed by the lowercase version of the character mangle c h a rs are replaced by 2 mangle c h a rs this method is to get around the stupid windows problem where filenames are not case sensitive under windows , foo exe and foo exe represent the same filename to fix this we mangle names first such that foo exe becomes foo exe

public static string mangle ( string name ) { int len = name length ( ) ; string buffer buf = new string buffer ( 2 * len ) ; for ( int i = 0 ; i < len ; i + + ) { char c = name char at ( i ) ; if ( c = = mangle char ) { buf append ( mangle char ) ; buf append ( mangle char ) ; } else if ( character is upper case ( c ) ) { buf append ( mangle char ) ; buf append ( character to lower case ( c ) ) ; } else { buf append ( c ) ; } } return buf to string ( ) ; }


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


return true if the given data type is the same type of any data types in the list

private boolean exists ( data type dt ) { for ( int i = 0 ; i < data list size ( ) ; i + + ) { data type d = data list get ( i ) ; if ( dt is equivalent ( d ) ) { return true ; } } return false ; }


public cancellable get pipeline async ( get pipeline request request , request options options , action listener < get pipeline response > listener ) { return rest high level client perform request async and parse entity ( request , ingest request converters : : get pipeline , options , get pipeline response : : from x content , listener , collections singleton ( 404 ) ) ; }


raw { @ code get file status } that talks direct to s3 used to implement { @ link # inner get file status ( path , boolean , set ) } , and for direct management of empty directory blobs checks made , in order : head : look for an object at the given key , provided that the key doesn ' t end in " " dir marker : look for the directory marker - the key with a trailing if not passed in if an object was found with size 0 bytes , a directory status entry is returned which declares that the directory is empty list : issue a list on the key ( with if needed ) , require one entry to be found for the path to be considered a non - empty directory notes : objects ending in which are not 0 - bytes long are not treated as directory markers , but instead as files there ' s ongoing discussions about whether a dir marker should be interpreted as an empty dir the head requests require the permissions to read an object , including ( we believe ) the ability to decrypt the file at the very least , for sse - c markers , you need the same key on the client for the head to work the list probe needs list permission ; it is also more prone to inconsistency , even on newly created files retry policy : retry translated

s 3 a file status s 3 get file status ( final path path , final string key , final set < status probe enum > probes , @ nullable final set < path > tombstones , final boolean need empty directory flag ) throws i o exception { log debug ( " s 3 get file status { } " , path ) ; / / either you aren ' t looking for the directory flag , or you are , / / and if you are , the probe list must contain list preconditions check argument ( ! need empty directory flag | | probes contains ( status probe enum list ) , " s 3 get file status ( % s ) wants to know if a directory is empty but " + " does not request a list probe " , path ) ; if ( key is empty ( ) & & ! need empty directory flag ) { return new s 3 a file status ( tristate unknown , path , username ) ; } if ( ! key is empty ( ) & & ! key ends with ( " / " ) & & probes contains ( status probe enum head ) ) { try { / / look for the simple file object metadata meta = get object metadata ( key ) ; log debug ( " found exact file : normal file { } " , key ) ; return new s 3 a file status ( meta get content length ( ) , date to long ( meta get last modified ( ) ) , path , get default block size ( path ) , username , meta get e tag ( ) , meta get version id ( ) ) ; } catch ( amazon service exception e ) { / / if the response is a 404 error , it just means that there is / / no file at that path the remaining checks will be needed if ( e get status code ( ) ! = sc 404 | | is unknown bucket ( e ) ) { throw translate exception ( " get file status " , path , e ) ; } } catch ( amazon client exception e ) { throw translate exception ( " get file status " , path , e ) ; } } / / execute the list if ( probes contains ( status probe enum list ) ) { try { / / this will find a marker dir / as well as an entry / / when making a simple " is this a dir check " all is good / / but when looking for an empty dir , we need to verify there are no / / children , so ask for two entries , so as to find / / a child string dir key = maybe add trailing slash ( key ) ; / / list size is dir marker + at least one non - tombstone entry / / there ' s a corner case : more tombstones than you have in a / / single page list we assume that if you have been deleting / / that many files , then the aws listing will have purged some / / by the time of listing so that the response includes some / / which have not int list size ; if ( tombstones = = null ) { / / no tombstones so look for a marker and at least one child list size = 2 ; } else { / / build a listing > tombstones if the caller has many thousands / / of tombstones this won ' t work properly , which is why pruning / / of expired tombstones matters list size = math min ( 2 + tombstones size ( ) , math max ( 2 , max keys ) ) ; } s 3 list request request = create list objects request ( dir key , " / " , list size ) ; / / execute the request s 3 list result list result = list objects ( request , get duration tracker factory ( ) ) ; if ( list result has prefixes or objects ( context accessors , tombstones ) ) { if ( log is debug enabled ( ) ) { log debug ( " found path as directory ( with / ) " ) ; list result log at debug ( log ) ; } / / at least one entry has been found / / if looking for an empty directory , the marker must exist but no / / children / / so the listing must contain the marker entry only if ( need empty directory flag & & list result represents empty directory ( context accessors , dir key , tombstones ) ) { return new s 3 a file status ( tristate true , path , username ) ; } / / either an empty directory is not needed , or the / / listing does not meet the requirements return new s 3 a file status ( tristate false , path , username ) ; } else if ( key is empty ( ) ) { log debug ( " found root directory " ) ; return new s 3 a file status ( tristate true , path , username ) ; } } catch ( amazon service exception e ) { if ( e get status code ( ) ! = sc 404 | | is unknown bucket ( e ) ) { throw translate exception ( " get file status " , path , e ) ; } } catch ( amazon client exception e ) { throw translate exception ( " get file status " , path , e ) ; } } log debug ( " not found : { } " , path ) ; throw new file not found exception ( " no such file or directory : " + path ) ; }


if a bundle is a " system bundle " it cannot be removed and its contends cannot be edited

public boolean is system bundle ( ) { return system bundle ; }


clients should override this method if the post - processing cannot be done in place if the post - processing can be done in place , clients should override the { @ link # process ( bitmap ) } method the provided destination bitmap is of the same size as the source bitmap there are no guarantees on the initial content of the destination bitmap , so the implementation has to make sure that it properly populates it the source bitmap must not be modified as it may be shared by the other clients the implementation must use the provided destination bitmap as its output

public void process ( bitmap dest bitmap , bitmap source bitmap ) { internal copy bitmap ( dest bitmap , source bitmap ) ; process ( dest bitmap ) ; }


does this committer have a thread pool ?

public synchronized boolean has thread pool ( ) { return thread pool ! = null ; }


creates a { @ link future combiner } requiring that all passed in futures are successful if any input fails , the returned future fails immediately

public static < v > future combiner < v > when all succeed ( listenable future < ? extends v > futures ) { return new future combiner < v > ( true , immutable list copy of ( futures ) ) ; }


get the string value for an instance setting

public string get string settings value ( address data addr , string name ) { instance settings d b settings = get instance settings d b ( data addr , name ) ; if ( settings ! = null ) { return settings get string value ( ) ; } return null ; }


helper method to configure the bearer token

public void set bearer token ( string bearer token ) { for ( request interceptor api authorization : api authorizations values ( ) ) { if ( api authorization instanceof http bearer auth ) { ( ( http bearer auth ) api authorization ) set bearer token ( bearer token ) ; return ; } } throw new runtime exception ( " no bearer authentication configured ! " ) ; }


run all pending scheduled tasks in the { @ link event loop } for this { @ link channel } and return the { @ code nanoseconds } when the next scheduled task is ready to run if no other task was scheduled it will return { @ code - 1 }

public long run scheduled pending tasks ( ) { try { return loop run scheduled tasks ( ) ; } catch ( exception e ) { record exception ( e ) ; return loop next scheduled task ( ) ; } }


tests that removed partitions will be removed from subscribed partitions even if it ' s still in restored partitions ( filter restored partitions with discovered is active )

public void test set filter restored paritions with removed topic ( ) throws exception { check filter restored partitions with disovered ( arrays as list ( new string [ ] { " kafka topic 1 " , " kafka topic 2 " } ) , arrays as list ( new string [ ] { " kafka topic 1 " } ) , arrays as list ( new string [ ] { " kafka topic 1 " } ) , false ) ; }


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


replaces the external result function with the origin function < br > note : this method will replace the function , but does not create the parent namespace or put the function in the parent namespace this must be done separately

public function replace external function ( function to function , function from function , task monitor monitor ) throws cancelled exception , unsupported operation exception { if ( ! to function is external ( ) ) { throw new illegal argument exception ( " the function being replaced is not an external " ) ; } if ( ! from function is external ( ) ) { throw new illegal argument exception ( " the function being used as the source of information for a replace is not an external " ) ; } stack frame origin frame = from function get stack frame ( ) ; / / do not replace the function name here , since the symbols need to get sorted out first / / after the symbols are merged you will need to replace the function symbol in case the / / merge of symbols was not chosen if ( to function has custom variable storage ( ) ! = from function has custom variable storage ( ) ) { to function set custom variable storage ( from function has custom variable storage ( ) ) ; } try { to function set calling convention ( from function get calling convention name ( ) ) ; } catch ( invalid input exception e ) { error msg append ( " address = " + to function get entry point ( ) + " : " + e get message ( ) + " \ n " ) ; } stack frame new to frame = to function get stack frame ( ) ; try { if ( to function has custom variable storage ( ) ) { variable return var = from function get return ( ) ; to function set return ( from function get return type ( ) , return var get variable storage ( ) , return var get source ( ) ) ; } else { to function set return type ( from function get return type ( ) , source type analysis ) ; } / / if ( new to frame get parameter offset ( ) ! = origin frame get parameter offset ( ) ) { / / new to frame set parameter offset ( origin frame get parameter offset ( ) ) ; / / } } catch ( invalid input exception e ) { msg error ( this , " unexpected exception : " + e get message ( ) , e ) ; error msg append ( " invalid input exception replacing external function : " + e get message ( ) + " \ n " ) ; } if ( new to frame get local size ( ) ! = origin frame get local size ( ) ) { new to frame set local size ( origin frame get local size ( ) ) ; } to function set stack purge size ( from function get stack purge size ( ) ) ; to function set var args ( from function has var args ( ) ) ; to function set inline ( from function is inline ( ) ) ; to function set no return ( from function has no return ( ) ) ; to function set signature source ( from function get signature source ( ) ) ; replace variables ( to function , from function , monitor ) ; / / restore variable refs ( new result function , restore refs ) ; return to function ; }


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

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


returns true if any bit in the given array is ' on ' ( set to 1 )

public static boolean contains on bit ( byte [ ] bytearray ) { for ( byte element : bytearray ) { int value = element & 0xff ; if ( value ! = 0 ) { return true ; } } return false ; }


forces a reset of the private queue counter could make changes to queue to make that easier , but decided against that

private void reset queue state ( ) throws i o exception { file queue file = r jenkins get queue ( ) get x m l queue file ( ) ; xml file xml file = new xml file ( queue xstream , queue file ) ; xml file write ( new queue state ( ) ) ; r jenkins get queue ( ) load ( ) ; }


creates { @ link filter } that all the incoming http requests will go through for authentication the default implementation uses { @ link # get security components ( ) } and builds a standard filter chain but subclasses can override this to completely change the filter sequence for other plugins that want to contribute { @ link filter } , see { @ link plugin servlet filter }

public filter create filter ( filter config filter config ) { logger entering ( security realm class get name ( ) , " create filter " ) ; security components sc = get security components ( ) ; list < filter > filters = new array list < > ( ) ; { http session security context repository http session security context repository = new http session security context repository ( ) ; http session security context repository set allow session creation ( false ) ; filters add ( new http session context integration filter 2 ( http session security context repository ) ) ; } { / / if any " authorization : basic xxx : yyy " is sent this is the filter that processes it basic header processor bhp = new basic header processor ( ) ; / / if basic authentication fails ( which only happens incorrect basic auth credential is sent ) , / / respond with 401 with basic auth request , instead of redirecting the user to the login page , / / since users of basic auth tends to be a program and won ' t see the redirection to the form / / page as a failure basic authentication entry point basic authentication entry point = new basic authentication entry point ( ) ; basic authentication entry point set realm name ( " jenkins " ) ; bhp set authentication entry point ( basic authentication entry point ) ; bhp set remember me services ( sc remember me 2 ) ; filters add ( bhp ) ; } { authentication processing filter 2 apf = new authentication processing filter 2 ( get authentication gateway url ( ) ) ; apf set authentication manager ( sc manager 2 ) ; apf set remember me services ( sc remember me 2 ) ; apf set authentication failure handler ( new simple url authentication failure handler ( " / login error " ) ) ; / / todo apf default target url = " / " try saved request aware authentication success handler filters add ( apf ) ; } filters add ( new remember me authentication filter ( sc manager 2 , sc remember me 2 ) ) ; filters add all ( common filters ( ) ) ; return new chained servlet filter ( filters ) ; }


abstract factory pattern for wrapping an { @ link s s l engine } object this is useful for npnapln support

s s l engine wrap ssl engine ( s s l engine engine , jdk application protocol negotiator application negotiator , boolean is server ) ;


returns the bytes and masking merged together , as a binary string

public string to binary string ( ) { string builder value string = new string builder ( ) ; string builder mask string = new string builder ( ) ; for ( int i = 0 ; i < value length ; i + + ) { value string append ( instruction search utils to binary string ( value [ i ] ) ) ; } for ( int i = 0 ; i < mask length ; i + + ) { mask string append ( instruction search utils to binary string ( mask [ i ] ) ) ; } string combined string = " " ; try { combined string = instruction search utils format search string ( value string to string ( ) , mask string to string ( ) ) ; } catch ( invalid input exception e ) { e print stack trace ( ) ; } return combined string ; }


sets the percentage of the progress meter that is filled in for the current phase progress area

void set current progress ( int current percent progress ) { provider set current progress ( current percent progress ) ; }


shut down immediately , aborting any work in progress and discarding all pending work it is legal to store pending work for another thread to process


if true , then bookmarks should be readwritten

public boolean is bookmarks ( ) { return bookmarks ; }


test the property ' enum form string array '

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