idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
31,300 | public static < E > Set < E > constrainedSet ( Set < E > set , Constraint < ? super E > constraint ) { return new ConstrainedSet < E > ( set , constraint ) ; } | Returns a constrained view of the specified set using the specified constraint . Any operations that add new elements to the set will call the provided constraint . However this method does not verify that existing elements satisfy the constraint . |
31,301 | public static < E > SortedSet < E > constrainedSortedSet ( SortedSet < E > sortedSet , Constraint < ? super E > constraint ) { return new ConstrainedSortedSet < E > ( sortedSet , constraint ) ; } | Returns a constrained view of the specified sorted set using the specified constraint . Any operations that add new elements to the sorted set will call the provided constraint . However this method does not verify that existing elements satisfy the constraint . |
31,302 | public static < E > List < E > constrainedList ( List < E > list , Constraint < ? super E > constraint ) { return ( list instanceof RandomAccess ) ? new ConstrainedRandomAccessList < E > ( list , constraint ) : new ConstrainedList < E > ( list , constraint ) ; } | Returns a constrained view of the specified list using the specified constraint . Any operations that add new elements to the list will call the provided constraint . However this method does not verify that existing elements satisfy the constraint . |
31,303 | private static < E > ListIterator < E > constrainedListIterator ( ListIterator < E > listIterator , Constraint < ? super E > constraint ) { return new ConstrainedListIterator < E > ( listIterator , constraint ) ; } | Returns a constrained view of the specified list iterator using the specified constraint . Any operations that would add new elements to the underlying list will be verified by the constraint . |
31,304 | public final Index createIndex ( PersistentStore store , HsqlName name , int [ ] columns , boolean [ ] descending , boolean [ ] nullsLast , boolean unique , boolean migrating , boolean constraint , boolean forward ) { Index newIndex = createAndAddIndexStructure ( name , columns , descending , nullsLast , unique , migra... | Create new memory - resident index . For MEMORY and TEXT tables . |
31,305 | public Type getCombinedType ( Type other , int operation ) { if ( operation != OpTypes . CONCAT ) { return getAggregateType ( other ) ; } Type newType ; long newPrecision = precision + other . precision ; switch ( other . typeCode ) { case Types . SQL_ALL_TYPES : return this ; case Types . SQL_BIT : newType = this ; br... | Returns type for concat |
31,306 | public VoltTable [ ] run ( SystemProcedureExecutionContext ctx ) { if ( ctx . isLowestSiteId ( ) ) { VoltDBInterface voltdb = VoltDB . instance ( ) ; OperationMode opMode = voltdb . getMode ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "voltdb opmode is " + opMode ) ; } ZooKeeper zk = voltdb . getHostMessenger ... | Enter admin mode |
31,307 | public void setGeneratedColumnInfo ( int generate , ResultMetaData meta ) { if ( type != StatementTypes . INSERT ) { return ; } int colIndex = baseTable . getIdentityColumnIndex ( ) ; if ( colIndex == - 1 ) { return ; } switch ( generate ) { case ResultConstants . RETURN_NO_GENERATED_KEYS : return ; case ResultConstant... | For the creation of the statement |
31,308 | void checkAccessRights ( Session session ) { if ( targetTable != null && ! targetTable . isTemp ( ) ) { targetTable . checkDataReadOnly ( ) ; session . checkReadWrite ( ) ; } if ( session . isAdmin ( ) ) { return ; } for ( int i = 0 ; i < sequences . length ; i ++ ) { session . getGrantee ( ) . checkAccess ( sequences ... | Determines if the authorizations are adequate to execute the compiled object . Completion requires the list of all database objects in a compiled statement . |
31,309 | public ResultMetaData getResultMetaData ( ) { switch ( type ) { case StatementTypes . DELETE_WHERE : case StatementTypes . INSERT : case StatementTypes . UPDATE_WHERE : case StatementTypes . MIGRATE_WHERE : return ResultMetaData . emptyResultMetaData ; default : throw Error . runtimeError ( ErrorCode . U_S0500 , "Compi... | Returns the metadata which is empty if the CompiledStatement does not generate a Result . |
31,310 | public String describe ( Session session ) { try { return describeImpl ( session ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; return e . toString ( ) ; } } | Retrieves a String representation of this object . |
31,311 | static boolean isGroupByColumn ( QuerySpecification select , int index ) { if ( ! select . isGrouped ) { return false ; } for ( int ii = 0 ; ii < select . groupIndex . getColumnCount ( ) ; ii ++ ) { if ( index == select . groupIndex . getColumns ( ) [ ii ] ) { return true ; } } return false ; } | Returns true if the specified exprColumn index is in the list of column indices specified by groupIndex |
31,312 | private static List < Expression > getDisplayColumnsForSetOp ( QueryExpression queryExpr ) { assert ( queryExpr != null ) ; if ( queryExpr . getLeftQueryExpression ( ) == null ) { assert ( queryExpr instanceof QuerySpecification ) ; QuerySpecification select = ( QuerySpecification ) queryExpr ; return select . displayC... | Return a list of the display columns for the left most statement from a set op |
31,313 | protected static List < VoltXMLElement > voltGetLimitOffsetXMLFromSortAndSlice ( Session session , SortAndSlice sortAndSlice ) throws HSQLParseException { List < VoltXMLElement > result = new ArrayList < > ( ) ; if ( sortAndSlice == null || sortAndSlice == SortAndSlice . noSort ) { return result ; } if ( sortAndSlice .... | return a list of VoltXMLElements that need to be added to the statement XML for LIMIT and OFFSET |
31,314 | public static Object getObjectFromString ( VoltType type , String value ) throws ParseException { Object ret = null ; switch ( type ) { case TINYINT : case SMALLINT : case INTEGER : case BIGINT : ret = Long . valueOf ( value ) ; break ; case FLOAT : ret = Double . valueOf ( value ) ; break ; case STRING : ret = value ;... | Returns a casted object of the input value string based on the given type |
31,315 | public static VoltType getNumericLiteralType ( VoltType vt , String value ) { try { Long . parseLong ( value ) ; } catch ( NumberFormatException e ) { return VoltType . DECIMAL ; } return vt ; } | If the type is NUMERIC from hsqldb VoltDB has to decide its real type . It s either INTEGER or DECIMAL according to the SQL Standard . Thanks for Hsqldb 1 . 9 FLOAT literal values have been handled well with E sign . |
31,316 | private static void writeLength ( ByteBuffer buf , int length ) { assert ( length >= 0 ) ; assert ( length == ( length & ( ~ length + 1 ) ) ) ; byte log2size = ( byte ) ( 32 - Integer . numberOfLeadingZeros ( length ) ) ; buf . put ( log2size ) ; } | Over - clever way to store lots of lengths in a single byte Length must be a power of two > = 0 . |
31,317 | public OpsAgent getAgent ( OpsSelector selector ) { OpsAgent agent = m_agents . get ( selector ) ; assert ( agent != null ) ; return agent ; } | Return the OpsAgent for the specified selector . |
31,318 | public void shutdown ( ) { for ( Entry < OpsSelector , OpsAgent > entry : m_agents . entrySet ( ) ) { try { entry . getValue ( ) . shutdown ( ) ; } catch ( InterruptedException e ) { } } m_agents . clear ( ) ; } | Shutdown all the OpsAgent s executor services . Should be possible to eventually consolidate all of them into a single executor service . |
31,319 | public String add ( ProcedureDescriptor descriptor ) throws VoltCompilerException { assert descriptor != null ; String className = descriptor . m_className ; assert className != null && ! className . trim ( ) . isEmpty ( ) ; String shortName = deriveShortProcedureName ( className ) ; if ( m_procedureMap . containsKey (... | Tracks the given procedure descriptor if it is not already tracked |
31,320 | public void removeProcedure ( String procName , boolean ifExists ) throws VoltCompilerException { assert procName != null && ! procName . trim ( ) . isEmpty ( ) ; String shortName = deriveShortProcedureName ( procName ) ; if ( m_procedureMap . containsKey ( shortName ) ) { m_procedureMap . remove ( shortName ) ; } else... | Searches for and removes the Procedure provided in prior DDL statements |
31,321 | public void addProcedurePartitionInfoTo ( String procedureName , ProcedurePartitionData data ) throws VoltCompilerException { ProcedureDescriptor descriptor = m_procedureMap . get ( procedureName ) ; if ( descriptor == null ) { throw m_compiler . new VoltCompilerException ( String . format ( "Partition references an un... | Associates the given partition info to the given tracked procedure |
31,322 | void addExportedTable ( String tableName , String targetName , boolean isStream ) { assert tableName != null && ! tableName . trim ( ) . isEmpty ( ) ; assert targetName != null && ! targetName . trim ( ) . isEmpty ( ) ; targetName = targetName . toUpperCase ( ) ; if ( isStream ) { NavigableSet < String > tableGroup = m... | Track an exported table |
31,323 | static < E > ImmutableList < E > asImmutableList ( Object [ ] elements , int length ) { switch ( length ) { case 0 : return of ( ) ; case 1 : @ SuppressWarnings ( "unchecked" ) ImmutableList < E > list = new SingletonImmutableList < E > ( ( E ) elements [ 0 ] ) ; return list ; default : if ( length < elements . length ... | Views the array as an immutable list . Copies if the specified range does not cover the complete array . Does not check for nulls . |
31,324 | public < E extends T > E min ( Iterable < E > iterable ) { return min ( iterable . iterator ( ) ) ; } | Returns the least of the specified values according to this ordering . If there are multiple least values the first of those is returned . |
31,325 | static long calculateAverage ( long currAvg , long currInvoc , long rowAvg , long rowInvoc ) { long currTtl = currAvg * currInvoc ; long rowTtl = rowAvg * rowInvoc ; if ( ( currInvoc + rowInvoc ) == 0L ) { return 0L ; } else { return ( currTtl + rowTtl ) / ( currInvoc + rowInvoc ) ; } } | Given a running average and the running invocation total as well as a new row s average and invocation total return a new running average |
31,326 | static void addToRecentConnectionSettings ( Hashtable settings , ConnectionSetting newSetting ) throws IOException { settings . put ( newSetting . getName ( ) , newSetting ) ; ConnectionDialogCommon . storeRecentConnectionSettings ( settings ) ; } | Adds the new settings name if it does not nexist or overwrites the old one . |
31,327 | private static void storeRecentConnectionSettings ( Hashtable settings ) { try { if ( recentSettings == null ) { setHomeDir ( ) ; if ( homedir == null ) { return ; } recentSettings = new File ( homedir , fileName ) ; if ( ! recentSettings . exists ( ) ) { } } if ( settings == null || settings . size ( ) == 0 ) { return... | Here s a non - secure method of storing recent connection settings . |
31,328 | static void deleteRecentConnectionSettings ( ) { try { if ( recentSettings == null ) { setHomeDir ( ) ; if ( homedir == null ) { return ; } recentSettings = new File ( homedir , fileName ) ; } if ( ! recentSettings . exists ( ) ) { recentSettings = null ; return ; } recentSettings . delete ( ) ; recentSettings = null ;... | Removes the recent connection settings file store . |
31,329 | public Map < Integer , ClientAffinityStats > getAffinityStats ( ) { Map < Integer , ClientAffinityStats > retval = new TreeMap < Integer , ClientAffinityStats > ( ) ; for ( Entry < Integer , ClientAffinityStats > e : m_currentAffinity . entrySet ( ) ) { if ( m_baselineAffinity . containsKey ( e . getKey ( ) ) ) { retva... | Get the client affinity stats . Will only be populated if client affinity is enabled . |
31,330 | public ClientAffinityStats getAggregateAffinityStats ( ) { long afWrites = 0 ; long afReads = 0 ; long rrWrites = 0 ; long rrReads = 0 ; Map < Integer , ClientAffinityStats > affinityStats = getAffinityStats ( ) ; for ( Entry < Integer , ClientAffinityStats > e : affinityStats . entrySet ( ) ) { afWrites += e . getValu... | Roll up the per - partition affinity stats and return the totals for each of the four categories . Will only be populated if client affinity is enabled . |
31,331 | public static HSQLDDLInfo preprocessHSQLDDL ( String ddl ) { ddl = SQLLexer . stripComments ( ddl ) ; Matcher matcher = HSQL_DDL_PREPROCESSOR . matcher ( ddl ) ; if ( matcher . find ( ) ) { String verbString = matcher . group ( "verb" ) ; HSQLDDLInfo . Verb verb = HSQLDDLInfo . Verb . get ( verbString ) ; if ( verb == ... | Glean some basic info about DDL statements sent to HSQLDB |
31,332 | public void doRestart ( List < Long > masters , Map < Integer , Long > partitionMasters ) { List < Long > copy = new ArrayList < Long > ( masters ) ; m_restartMasters . set ( copy ) ; m_restartMastersMap . set ( Maps . newHashMap ( partitionMasters ) ) ; } | Update the list of partition masters to be used when this transaction is restarted . Currently thread - safe because we call this before poisoning the MP Transaction to restart it and only do this sequentially from the repairing thread . |
31,333 | public boolean activate ( SystemProcedureExecutionContext context , boolean undo , byte [ ] predicates ) { if ( ! context . activateTableStream ( m_tableId , m_type , undo , predicates ) ) { String tableName = CatalogUtil . getTableNameFromId ( context . getDatabase ( ) , m_tableId ) ; log . debug ( "Attempted to activ... | Activate the stream with the given predicates on the given table . |
31,334 | public Pair < ListenableFuture < ? > , Boolean > streamMore ( SystemProcedureExecutionContext context , List < DBBPool . BBContainer > outputBuffers , int [ ] rowCountAccumulator ) { ListenableFuture < ? > writeFuture = null ; prepareBuffers ( outputBuffers ) ; Pair < Long , int [ ] > serializeResult = context . tableS... | Streams more tuples from the table . |
31,335 | private void prepareBuffers ( List < DBBPool . BBContainer > buffers ) { Preconditions . checkArgument ( buffers . size ( ) == m_tableTasks . size ( ) ) ; UnmodifiableIterator < SnapshotTableTask > iterator = m_tableTasks . iterator ( ) ; for ( DBBPool . BBContainer container : buffers ) { int headerSize = iterator . n... | Set the positions of the buffers to the start of the content leaving some room for the headers . |
31,336 | private ListenableFuture < ? > writeBlocksToTargets ( Collection < DBBPool . BBContainer > outputBuffers , int [ ] serialized ) { Preconditions . checkArgument ( m_tableTasks . size ( ) == serialized . length ) ; Preconditions . checkArgument ( outputBuffers . size ( ) == serialized . length ) ; final List < Listenable... | Finalize the output buffers and write them to the corresponding data targets |
31,337 | public void recordValue ( final long value ) throws ArrayIndexOutOfBoundsException { long criticalValueAtEnter = recordingPhaser . writerCriticalSectionEnter ( ) ; try { activeHistogram . recordValue ( value ) ; } finally { recordingPhaser . writerCriticalSectionExit ( criticalValueAtEnter ) ; } } | Record a value |
31,338 | public static < K , V > HashBiMap < K , V > create ( int expectedSize ) { return new HashBiMap < K , V > ( expectedSize ) ; } | Constructs a new empty bimap with the specified expected size . |
31,339 | public void repairSurvivors ( ) { if ( this . m_promotionResult . isCancelled ( ) ) { repairLogger . debug ( m_whoami + "Skipping repair message creation for cancelled Term." ) ; return ; } int queued = 0 ; if ( repairLogger . isDebugEnabled ( ) ) { repairLogger . debug ( m_whoami + "received all repair logs and is rep... | Send missed - messages to survivors . |
31,340 | void init ( ResultMetaData meta , HsqlProperties props ) throws SQLException { resultMetaData = meta ; columnCount = resultMetaData . getColumnCount ( ) ; useColumnName = ( props == null ) ? true : props . isPropertyTrue ( "get_column_name" , true ) ; } | Initializes this JDBCResultSetMetaData object from the specified Result and HsqlProperties objects . |
31,341 | Map < Long , Long > reconfigureOnFault ( Set < Long > hsIds , FaultMessage fm ) { return reconfigureOnFault ( hsIds , fm , new HashSet < Long > ( ) ) ; } | Convenience wrapper for tests that don t care about unknown sites |
31,342 | public Map < Long , Long > reconfigureOnFault ( Set < Long > hsIds , FaultMessage fm , Set < Long > unknownFaultedSites ) { boolean proceed = false ; do { Discard ignoreIt = mayIgnore ( hsIds , fm ) ; if ( Discard . DoNot == ignoreIt ) { m_inTrouble . put ( fm . failedSite , fm . witnessed || fm . decided ) ; m_recover... | Process the fault message and if necessary start arbitration . |
31,343 | public static AbstractExpression createIndexExpressionForTable ( Table table , Map < Integer , Integer > ranges ) { HashRangeExpression predicate = new HashRangeExpression ( ) ; predicate . setRanges ( ranges ) ; predicate . setHashColumnIndex ( table . getPartitioncolumn ( ) . getIndex ( ) ) ; return predicate ; } | Create the expression used to build elastic index for a given table . |
31,344 | public void initialize ( ) throws Exception { List < Long > acctList = new ArrayList < Long > ( config . custcount * 2 ) ; List < String > stList = new ArrayList < String > ( config . custcount * 2 ) ; System . out . println ( "generating " + config . custcount + " customers..." ) ; for ( int c = 0 ; c < config . custc... | this gets run once before the benchmark begins |
31,345 | public static void createHierarchy ( ZooKeeper zk ) { LinkedList < ZKUtil . StringCallback > callbacks = new LinkedList < ZKUtil . StringCallback > ( ) ; for ( String node : CoreZK . ZK_HIERARCHY ) { ZKUtil . StringCallback cb = new ZKUtil . StringCallback ( ) ; callbacks . add ( cb ) ; zk . create ( node , null , Ids ... | Creates the ZK directory nodes . Only the leader should do this . |
31,346 | public static int createRejoinNodeIndicator ( ZooKeeper zk , int hostId ) { try { zk . create ( rejoin_node_blocker , ByteBuffer . allocate ( 4 ) . putInt ( hostId ) . array ( ) , Ids . OPEN_ACL_UNSAFE , CreateMode . PERSISTENT ) ; } catch ( KeeperException e ) { if ( e . code ( ) == KeeperException . Code . NODEEXISTS... | Creates a rejoin blocker for the given rejoining host . This prevents other hosts from rejoining at the same time . |
31,347 | public static boolean removeRejoinNodeIndicatorForHost ( ZooKeeper zk , int hostId ) { try { Stat stat = new Stat ( ) ; final int rejoiningHost = ByteBuffer . wrap ( zk . getData ( rejoin_node_blocker , false , stat ) ) . getInt ( ) ; if ( hostId == rejoiningHost ) { zk . delete ( rejoin_node_blocker , stat . getVersio... | Removes the rejoin blocker if the current rejoin blocker contains the given host ID . |
31,348 | public static boolean removeJoinNodeIndicatorForHost ( ZooKeeper zk , int hostId ) { try { Stat stat = new Stat ( ) ; String path = ZKUtil . joinZKPath ( readyjoininghosts , Integer . toString ( hostId ) ) ; zk . getData ( path , false , stat ) ; zk . delete ( path , stat . getVersion ( ) ) ; return true ; } catch ( Ke... | Removes the join indicator for the given host ID . |
31,349 | public static boolean isPartitionCleanupInProgress ( ZooKeeper zk ) throws KeeperException , InterruptedException { List < String > children = zk . getChildren ( VoltZK . leaders_initiators , null ) ; List < ZKUtil . ChildrenCallback > childrenCallbacks = Lists . newArrayList ( ) ; for ( String child : children ) { ZKU... | Checks if the cluster suffered an aborted join or node shutdown and is still in the process of cleaning up . |
31,350 | public boolean isNullable ( ) { boolean isNullable = super . isNullable ( ) ; if ( isNullable ) { if ( dataType . isDomainType ( ) ) { return dataType . userTypeModifier . isNullable ( ) ; } } return isNullable ; } | Is column nullable . |
31,351 | Object getDefaultValue ( Session session ) { return defaultExpression == null ? null : defaultExpression . getValue ( session , dataType ) ; } | Returns default value in the session context . |
31,352 | Object getGeneratedValue ( Session session ) { return generatingExpression == null ? null : generatingExpression . getValue ( session , dataType ) ; } | Returns generated value in the session context . |
31,353 | public String getDefaultSQL ( ) { String ddl = null ; ddl = defaultExpression == null ? null : defaultExpression . getSQL ( ) ; return ddl ; } | Returns SQL for default value . |
31,354 | Expression getDefaultExpression ( ) { if ( defaultExpression == null ) { if ( dataType . isDomainType ( ) ) { return dataType . userTypeModifier . getDefaultClause ( ) ; } return null ; } else { return defaultExpression ; } } | Returns default expression for the column . |
31,355 | public static ZKUtil . StringCallback createSnapshotCompletionNode ( String path , String pathType , String nonce , long txnId , boolean isTruncation , String truncReqId ) { if ( ! ( txnId > 0 ) ) { VoltDB . crashGlobalVoltDB ( "Txnid must be greather than 0" , true , null ) ; } byte nodeBytes [ ] = null ; try { JSONSt... | Create the completion node for the snapshot identified by the txnId . It assumes that all hosts will race to call this so it doesn t fail if the node already exists . |
31,356 | public static void logParticipatingHostCount ( long txnId , int participantCount ) { ZooKeeper zk = VoltDB . instance ( ) . getHostMessenger ( ) . getZK ( ) ; final String snapshotPath = VoltZK . completed_snapshots + "/" + txnId ; boolean success = false ; while ( ! success ) { Stat stat = new Stat ( ) ; byte data [ ]... | Once participating host count is set SnapshotCompletionMonitor can check this ZK node to determine whether the snapshot has finished or not . |
31,357 | public synchronized void close ( ) { this . isPoolClosed = true ; while ( this . connectionsInactive . size ( ) > 0 ) { PooledConnection connection = dequeueFirstIfAny ( ) ; if ( connection != null ) { closePhysically ( connection , "closing inactive connection when connection pool was closed." ) ; } } } | Closes this connection pool . No further connections can be obtained from it after this . All inactive connections are physically closed before the call returns . Active connections are not closed . There may still be active connections in use after this method returns . When these connections are closed and returned t... |
31,358 | public synchronized void closeImmediatedly ( ) { close ( ) ; Iterator iterator = this . connectionsInUse . iterator ( ) ; while ( iterator . hasNext ( ) ) { PooledConnection connection = ( PooledConnection ) iterator . next ( ) ; SessionConnectionWrapper sessionWrapper = ( SessionConnectionWrapper ) this . sessionConne... | Closes this connection |
31,359 | public void setDriverClassName ( String driverClassName ) { if ( driverClassName . equals ( JDBCConnectionPoolDataSource . driver ) ) { return ; } throw new RuntimeException ( "This class only supports JDBC driver '" + JDBCConnectionPoolDataSource . driver + "'" ) ; } | For compatibility . |
31,360 | public void toJSONString ( JSONStringer stringer ) throws JSONException { super . toJSONString ( stringer ) ; stringer . key ( "AGGREGATE_COLUMNS" ) . array ( ) ; for ( int ii = 0 ; ii < m_aggregateTypes . size ( ) ; ii ++ ) { stringer . object ( ) ; stringer . keySymbolValuePair ( Members . AGGREGATE_TYPE . name ( ) ,... | Serialize to JSON . We only serialize the expressions and not the directions . We won t need them in the executor . The directions will be in the order by plan node in any case . |
31,361 | public void loadFromJSONObject ( JSONObject jobj , Database db ) throws JSONException { helpLoadFromJSONObject ( jobj , db ) ; JSONArray jarray = jobj . getJSONArray ( Members . AGGREGATE_COLUMNS . name ( ) ) ; int size = jarray . length ( ) ; for ( int i = 0 ; i < size ; i ++ ) { assert ( i == 0 ) ; JSONObject tempObj... | Deserialize a PartitionByPlanNode from JSON . Since we don t need the sort directions and we don t serialize them in toJSONString then we can t in general get them here . |
31,362 | public void run ( ) { Thread . currentThread ( ) . setName ( "Latency Watchdog" ) ; LOG . info ( String . format ( "Latency Watchdog enabled -- threshold:%d(ms) " + "wakeup_interval:%d(ms) min_log_interval:%d(ms)\n" , WATCHDOG_THRESHOLD , WAKEUP_INTERVAL , MIN_LOG_INTERVAL ) ) ; while ( true ) { for ( Entry < Thread , ... | The watchdog thread will be invoked every WAKEUP_INTERVAL time to check if any thread that be monitored has not updated its time stamp more than WATCHDOG_THRESHOLD millisecond . Same stack trace messages are rate limited by MIN_LOG_INTERVAL . |
31,363 | public static ProcedurePartitionData fromPartitionInfoString ( String partitionInfoString ) { if ( partitionInfoString == null || partitionInfoString . trim ( ) . isEmpty ( ) ) { return new ProcedurePartitionData ( ) ; } String [ ] partitionInfoParts = new String [ 0 ] ; partitionInfoParts = partitionInfoString . split... | For Testing usage ONLY . From a partition information string to |
31,364 | public void runDDL ( String ddl ) { String modifiedDdl = transformDDL ( ddl ) ; printTransformedSql ( ddl , modifiedDdl ) ; super . runDDL ( modifiedDdl , false ) ; } | Modifies DDL statements in such a way that PostGIS results will match VoltDB results and then passes the remaining work to the base class version . |
31,365 | public void allHostNTProcedureCallback ( ClientResponse clientResponse ) { synchronized ( m_allHostCallbackLock ) { int hostId = Integer . parseInt ( clientResponse . getAppStatusString ( ) ) ; boolean removed = m_outstandingAllHostProcedureHostIds . remove ( hostId ) ; if ( ! removed ) { tmLog . error ( String . forma... | This is called when an all - host proc responds from a particular node . It completes the future when all of the |
31,366 | protected CompletableFuture < Map < Integer , ClientResponse > > callAllNodeNTProcedure ( String procName , Object ... params ) { if ( ! m_outstandingAllHostProc . compareAndSet ( false , true ) ) { throw new VoltAbortException ( new IllegalStateException ( "Only one AllNodeNTProcedure operation can be running at a tim... | Send an invocation directly to each host s CI mailbox . This ONLY works for NT procedures . Track responses and complete the returned future when they re all accounted for . |
31,367 | private void completeCall ( ClientResponseImpl response ) { if ( m_perCallStats . samplingProcedure ( ) ) { m_perCallStats . setResultSize ( response . getResults ( ) ) ; } m_statsCollector . endProcedure ( response . getStatus ( ) == ClientResponse . USER_ABORT , ( response . getStatus ( ) != ClientResponse . USER_ABO... | Send a response back to the proc caller . Refactored out of coreCall for both regular and exceptional paths . |
31,368 | public void processAnyCallbacksFromFailedHosts ( Set < Integer > failedHosts ) { synchronized ( m_allHostCallbackLock ) { failedHosts . stream ( ) . forEach ( i -> { if ( m_outstandingAllHostProcedureHostIds . contains ( i ) ) { ClientResponseImpl cri = new ClientResponseImpl ( ClientResponse . CONNECTION_LOST , new Vo... | For all - host NT procedures use site failures to call callbacks for hosts that will obviously never respond . |
31,369 | public final static void log ( int logger , int level , String statement ) { if ( logger < loggers . length ) { switch ( level ) { case trace : loggers [ logger ] . trace ( statement ) ; break ; case debug : loggers [ logger ] . debug ( statement ) ; break ; case error : loggers [ logger ] . error ( statement ) ; break... | All EE loggers will call this static method from C and specify the logger and level they want to log to . The level will be checked again in Java . |
31,370 | public static void restoreFile ( String sourceName , String destName ) throws IOException { RandomAccessFile source = new RandomAccessFile ( sourceName , "r" ) ; RandomAccessFile dest = new RandomAccessFile ( destName , "rw" ) ; while ( source . getFilePointer ( ) != source . length ( ) ) { int size = source . readInt ... | buggy database files had size == position == 0 at the end |
31,371 | String getHTMLForAdminPage ( Map < String , String > params ) { try { String template = m_htmlTemplates . get ( "admintemplate.html" ) ; for ( Entry < String , String > e : params . entrySet ( ) ) { String key = e . getKey ( ) . toUpperCase ( ) ; String value = e . getValue ( ) ; if ( key == null ) continue ; if ( valu... | Load a template for the admin page fill it out and return the value . |
31,372 | public void start ( ) throws InterruptedException , ExecutionException { Future < ? > task = es . submit ( handlePartitionChange ) ; task . get ( ) ; } | Start monitoring the leaders . This is a blocking operation . |
31,373 | public static Long update ( final long now ) { final long estNow = EstTime . m_now ; if ( estNow == now ) { return null ; } EstTime . m_now = now ; if ( now - estNow > ESTIMATED_TIME_WARN_INTERVAL ) { if ( lastErrorReport > now ) { lastErrorReport = now ; } if ( now - lastErrorReport > maxErrorReportInterval ) { lastEr... | Don t call this unless you have paused the updater and intend to update yourself |
31,374 | StatementDMQL compileMigrateStatement ( RangeVariable [ ] outerRanges ) { final Expression condition ; assert token . tokenType == Tokens . MIGRATE ; read ( ) ; readThis ( Tokens . FROM ) ; RangeVariable [ ] rangeVariables = { readSimpleRangeVariable ( StatementTypes . MIGRATE_WHERE ) } ; Table table = rangeVariables [... | Creates a MIGRATE - type statement from this parser context ( i . e . MIGRATE FROM tbl WHERE ... |
31,375 | StatementDMQL compileDeleteStatement ( RangeVariable [ ] outerRanges ) { Expression condition = null ; boolean truncate = false ; boolean restartIdentity = false ; switch ( token . tokenType ) { case Tokens . TRUNCATE : { read ( ) ; readThis ( Tokens . TABLE ) ; truncate = true ; break ; } case Tokens . DELETE : { read... | Creates a DELETE - type Statement from this parse context . |
31,376 | StatementDMQL compileUpdateStatement ( RangeVariable [ ] outerRanges ) { read ( ) ; Expression [ ] updateExpressions ; int [ ] columnMap ; boolean [ ] columnCheckList ; OrderedHashSet colNames = new OrderedHashSet ( ) ; HsqlArrayList exprList = new HsqlArrayList ( ) ; RangeVariable [ ] rangeVariables = { readSimpleRang... | Creates an UPDATE - type Statement from this parse context . |
31,377 | private void readMergeWhen ( OrderedHashSet insertColumnNames , OrderedHashSet updateColumnNames , HsqlArrayList insertExpressions , HsqlArrayList updateExpressions , RangeVariable [ ] targetRangeVars , RangeVariable sourceRangeVar ) { Table table = targetRangeVars [ 0 ] . rangeTable ; int columnCount = table . getColu... | Parses a WHEN clause from a MERGE statement . This can be either a WHEN MATCHED or WHEN NOT MATCHED clause or both and the appropriate values will be updated . |
31,378 | StatementDMQL compileCallStatement ( RangeVariable [ ] outerRanges , boolean isStrictlyProcedure ) { read ( ) ; if ( isIdentifier ( ) ) { checkValidCatalogName ( token . namePrePrefix ) ; RoutineSchema routineSchema = ( RoutineSchema ) database . schemaManager . findSchemaObject ( token . tokenString , session . getSch... | to do call argument name and type resolution |
31,379 | private SortAndSlice voltGetSortAndSliceForDelete ( RangeVariable [ ] rangeVariables ) { SortAndSlice sas = XreadOrderByExpression ( ) ; if ( sas == null || sas == SortAndSlice . noSort ) return SortAndSlice . noSort ; for ( int i = 0 ; i < sas . exprList . size ( ) ; ++ i ) { Expression e = ( Expression ) sas . exprLi... | This is a Volt extension to allow DELETE FROM tab ORDER BY c LIMIT 1 Adds a SortAndSlice object to the statement if the next tokens are ORDER BY LIMIT or OFFSET . |
31,380 | public ClassNameMatchStatus addPattern ( String classNamePattern ) { boolean matchFound = false ; if ( m_classList == null ) { m_classList = getClasspathClassFileNames ( ) ; } String preppedName = classNamePattern . trim ( ) ; int indexOfDollarSign = classNamePattern . indexOf ( '$' ) ; if ( indexOfDollarSign >= 0 ) { ... | Add a pattern that matches classes from the classpath and add any matching classnames to m_classNameMatches . |
31,381 | private static void processPathPart ( String path , Set < String > classes ) { File rootFile = new File ( path ) ; if ( rootFile . isDirectory ( ) == false ) { return ; } File [ ] files = rootFile . listFiles ( ) ; for ( File f : files ) { if ( f . getName ( ) . endsWith ( ".class" ) ) { String className = f . getName ... | For a given classpath root scan it for packages and classes adding all found classnames to the given classes param . |
31,382 | static String getClasspathClassFileNames ( ) { String classpath = System . getProperty ( "java.class.path" ) ; String [ ] pathParts = classpath . split ( File . pathSeparator ) ; Set < String > classes = new TreeSet < String > ( ) ; for ( String part : pathParts ) { processPathPart ( part , classes ) ; } StringBuilder ... | Get a single string that contains all of the non - jar classfiles in the current classpath separated by newlines . Classfiles are represented by their Java dot names not filenames . |
31,383 | double getMemoryLimitSize ( String sizeStr ) { if ( sizeStr == null || sizeStr . length ( ) == 0 ) { return 0 ; } try { if ( sizeStr . charAt ( sizeStr . length ( ) - 1 ) == '%' ) { int perc = Integer . parseInt ( sizeStr . substring ( 0 , sizeStr . length ( ) - 1 ) ) ; if ( perc < 0 || perc > 99 ) { throw new IllegalA... | package - private for junit |
31,384 | public static void validatePath ( String path ) throws IllegalArgumentException { if ( path == null ) { throw new IllegalArgumentException ( "Path cannot be null" ) ; } if ( path . length ( ) == 0 ) { throw new IllegalArgumentException ( "Path length must be > 0" ) ; } if ( path . charAt ( 0 ) != '/' ) { throw new Ille... | Validate the provided znode path string |
31,385 | protected void produceCopyForTransformation ( AbstractPlanNode copy ) { copy . m_outputSchema = m_outputSchema ; copy . m_hasSignificantOutputSchema = m_hasSignificantOutputSchema ; copy . m_outputColumnHints = m_outputColumnHints ; copy . m_estimatedOutputTupleCount = m_estimatedOutputTupleCount ; copy . m_estimatedPr... | Create a PlanNode that clones the configuration information but is not inserted in the plan graph and has a unique plan node id . |
31,386 | public void generateOutputSchema ( Database db ) { assert ( m_children . size ( ) == 1 ) ; AbstractPlanNode childNode = m_children . get ( 0 ) ; childNode . generateOutputSchema ( db ) ; m_hasSignificantOutputSchema = false ; m_outputSchema = childNode . getOutputSchema ( ) . copyAndReplaceWithTVE ( ) ; } | Generate the output schema for this node based on the output schemas of its children . The generated schema consists of the complete set of columns but is not yet ordered . |
31,387 | public void getTablesAndIndexes ( Map < String , StmtTargetTableScan > tablesRead , Collection < String > indexes ) { for ( AbstractPlanNode node : m_inlineNodes . values ( ) ) { node . getTablesAndIndexes ( tablesRead , indexes ) ; } for ( AbstractPlanNode node : m_children ) { node . getTablesAndIndexes ( tablesRead ... | Recursively build sets of tables read and index names used . |
31,388 | protected void getTablesAndIndexesFromSubqueries ( Map < String , StmtTargetTableScan > tablesRead , Collection < String > indexes ) { for ( AbstractExpression expr : findAllSubquerySubexpressions ( ) ) { assert ( expr instanceof AbstractSubqueryExpression ) ; AbstractSubqueryExpression subquery = ( AbstractSubqueryExp... | Collect read tables read and index names used in the current node subquery expressions . |
31,389 | public boolean isOutputOrdered ( List < AbstractExpression > sortExpressions , List < SortDirectionType > sortDirections ) { assert ( sortExpressions . size ( ) == sortDirections . size ( ) ) ; if ( m_children . size ( ) == 1 ) { return m_children . get ( 0 ) . isOutputOrdered ( sortExpressions , sortDirections ) ; } r... | Does the plan guarantee a result sorted according to the required sort order . The default implementation delegates the question to its child if there is only one child . |
31,390 | public final NodeSchema getTrueOutputSchema ( boolean resetBack ) throws PlanningErrorException { AbstractPlanNode child ; NodeSchema answer = null ; for ( child = this ; child != null ; child = ( child . getChildCount ( ) == 0 ) ? null : child . getChild ( 0 ) ) { NodeSchema childSchema ; if ( child . m_hasSignificant... | Find the true output schema . This may be in some child node . This seems to be the search order when constructing a plan node in the EE . |
31,391 | public void addAndLinkChild ( AbstractPlanNode child ) { assert ( child != null ) ; m_children . add ( child ) ; child . m_parents . add ( this ) ; } | Add a child and link this node child s parent . |
31,392 | public void setAndLinkChild ( int index , AbstractPlanNode child ) { assert ( child != null ) ; m_children . set ( index , child ) ; child . m_parents . add ( this ) ; } | Used to re - link the child without changing the order . |
31,393 | public void unlinkChild ( AbstractPlanNode child ) { assert ( child != null ) ; m_children . remove ( child ) ; child . m_parents . remove ( this ) ; } | Remove child from this node . |
31,394 | public boolean replaceChild ( AbstractPlanNode oldChild , AbstractPlanNode newChild ) { assert ( oldChild != null ) ; assert ( newChild != null ) ; int idx = 0 ; for ( AbstractPlanNode child : m_children ) { if ( child . equals ( oldChild ) ) { oldChild . m_parents . clear ( ) ; setAndLinkChild ( idx , newChild ) ; ret... | Replace an existing child with a new one preserving the child s position . |
31,395 | public void addIntermediary ( AbstractPlanNode node ) { Iterator < AbstractPlanNode > it = m_children . iterator ( ) ; while ( it . hasNext ( ) ) { AbstractPlanNode child = it . next ( ) ; it . remove ( ) ; assert child . getParentCount ( ) == 1 ; child . clearParents ( ) ; node . addAndLinkChild ( child ) ; } assert (... | Interject the provided node between this node and this node s current children |
31,396 | public boolean hasInlinedIndexScanOfTable ( String tableName ) { for ( int i = 0 ; i < getChildCount ( ) ; i ++ ) { AbstractPlanNode child = getChild ( i ) ; if ( child . hasInlinedIndexScanOfTable ( tableName ) == true ) { return true ; } } return false ; } | Refer to the override implementation on NestLoopIndexJoin node . |
31,397 | protected void findAllExpressionsOfClass ( Class < ? extends AbstractExpression > aeClass , Set < AbstractExpression > collected ) { for ( AbstractPlanNode inlineNode : getInlinePlanNodes ( ) . values ( ) ) { inlineNode . findAllExpressionsOfClass ( aeClass , collected ) ; } NodeSchema schema = getOutputSchema ( ) ; if... | Collect a unique list of expressions of a given type that this node has including its inlined nodes |
31,398 | public String toDOTString ( ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( m_id ) . append ( " [label=\"" ) . append ( m_id ) . append ( ": " ) . append ( getPlanNodeType ( ) ) . append ( "\" " ) ; sb . append ( getValueTypeDotString ( ) ) ; sb . append ( "];\n" ) ; for ( AbstractPlanNode node : m_inlineN... | produce a file that can imported into graphviz for easier visualization |
31,399 | private String getValueTypeDotString ( ) { PlanNodeType pnt = getPlanNodeType ( ) ; if ( isInline ( ) ) { return "fontcolor=\"white\" style=\"filled\" fillcolor=\"red\"" ; } if ( pnt == PlanNodeType . SEND || pnt == PlanNodeType . RECEIVE || pnt == PlanNodeType . MERGERECEIVE ) { return "fontcolor=\"white\" style=\"fil... | maybe not worth polluting |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.