@@ -33,6 +33,7 @@ vector<string> AntiCacheStats::generateAntiCacheStatsColumnNames() {
3333
3434 columnNames.push_back (" ANTICACHE_ID" );
3535 columnNames.push_back (" TABLE_ID" );
36+ columnNames.push_back (" ANTICACHEDB_TYPE" );
3637
3738 columnNames.push_back (" ANTICACHE_LAST_BLOCKS_EVICTED" );
3839 columnNames.push_back (" ANTICACHE_LAST_BYTES_EVICTED" );
@@ -68,6 +69,11 @@ void AntiCacheStats::populateAntiCacheStatsSchema(
6869 columnLengths.push_back (NValue::getTupleStorageSize (VALUE_TYPE_INTEGER));
6970 allowNull.push_back (false );
7071
72+ // AntiCacheDB_TYPE
73+ types.push_back (VALUE_TYPE_INTEGER);
74+ columnLengths.push_back (NValue::getTupleStorageSize (VALUE_TYPE_INTEGER));
75+ allowNull.push_back (false );
76+
7177 // ANTICACHE_LAST_BLOCKS_EVICTED
7278 types.push_back (VALUE_TYPE_INTEGER);
7379 columnLengths.push_back (NValue::getTupleStorageSize (VALUE_TYPE_INTEGER));
@@ -171,10 +177,12 @@ AntiCacheStats::AntiCacheStats(Table* table, AntiCacheDB* acdb)
171177 m_lastBlocksUnevicted = 0 ;
172178 m_lastBytesUnevicted = 0 ;
173179
180+ /*
174181 m_currentBlocksEvicted = 0;
175182 m_currentBytesEvicted = 0;
176183 m_currentBlocksUnevicted = 0;
177184 m_currentBytesUnevicted = 0;
185+ */
178186
179187
180188 m_currentEvictedBlocks = 0 ;
@@ -201,7 +209,7 @@ void AntiCacheStats::configure(
201209 CatalogId partitionId,
202210 CatalogId databaseId) {
203211 StatsSource::configure (name, hostId, hostname, siteId, partitionId, databaseId);
204- m_acid = acdb ->getACID ();
212+ m_acid = m_acdb ->getACID ();
205213}
206214
207215/* *
@@ -218,7 +226,7 @@ vector<string> AntiCacheStats::generateStatsColumnNames() {
218226 */
219227void AntiCacheStats::updateStatsTuple (TableTuple *tuple) {
220228
221- AntiCacheDB acdb = m_acdb;
229+ AntiCacheDB* acdb = m_acdb;
222230
223231 int32_t totalBlocksEvicted = acdb->getBlocksEvicted ();
224232 int64_t totalBytesEvicted = acdb->getBytesEvicted ();
@@ -243,42 +251,45 @@ void AntiCacheStats::updateStatsTuple(TableTuple *tuple) {
243251 tuple->setNValue (
244252 StatsSource::m_columnName2Index[" ANTICACHE_ID" ],
245253 ValueFactory::getIntegerValue (m_acid));
254+ tuple->setNValue (
255+ StatsSource::m_columnName2Index[" ANTICACHEDB_TYPE" ],
256+ ValueFactory::getIntegerValue (acdb->getDBType ()));
246257 tuple->setNValue (
247258 StatsSource::m_columnName2Index[" ANTICACHE_LAST_BLOCKS_EVICTED" ],
248- ValueFactory::getIntegerValue ());
259+ ValueFactory::getIntegerValue (m_lastBlocksEvicted ));
249260 tuple->setNValue (
250261 StatsSource::m_columnName2Index[" ANTICACHE_LAST_BYTES_EVICTED" ],
251- ValueFactory::getBigIntValue ());
262+ ValueFactory::getBigIntValue (m_lastBytesEvicted ));
252263 tuple->setNValue (
253264 StatsSource::m_columnName2Index[" ANTICACHE_LAST_BLOCKS_UNEVICTED" ],
254- ValueFactory::getIntegerValue ());
265+ ValueFactory::getIntegerValue (m_lastBlocksUnevicted ));
255266 tuple->setNValue (
256267 StatsSource::m_columnName2Index[" ANTICACHE_LAST_BYTES_UNEVICTED" ],
257- ValueFactory::getBigIntValue ());
268+ ValueFactory::getBigIntValue (m_lastBytesUnevicted ));
258269 tuple->setNValue (
259270 StatsSource::m_columnName2Index[" ANTICACHE_TOTAL_BLOCKS_EVICTED" ],
260- ValueFactory::getIntegerValue ());
271+ ValueFactory::getIntegerValue (m_totalBlocksEvicted ));
261272 tuple->setNValue (
262273 StatsSource::m_columnName2Index[" ANTICACHE_TOTAL_BYTES_EVICTED" ],
263- ValueFactory::getBigIntValue ());
274+ ValueFactory::getBigIntValue (m_totalBytesEvicted ));
264275 tuple->setNValue (
265276 StatsSource::m_columnName2Index[" ANTICACHE_TOTAL_BLOCKS_UNEVICTED" ],
266- ValueFactory::getIntegerValue ());
277+ ValueFactory::getIntegerValue (m_totalBlocksUnevicted ));
267278 tuple->setNValue (
268279 StatsSource::m_columnName2Index[" ANTICACHE_TOTAL_BYTES_UNEVICTED" ],
269- ValueFactory::getBigIntValue ());
280+ ValueFactory::getBigIntValue (m_totalBytesUnevicted ));
270281 tuple->setNValue (
271282 StatsSource::m_columnName2Index[" ANTICACHE_BLOCKS_STORED" ],
272- ValueFactory::getIntegerValue ());
283+ ValueFactory::getIntegerValue (m_totalBlocksEvicted - m_totalBlocksUnevicted ));
273284 tuple->setNValue (
274285 StatsSource::m_columnName2Index[" ANTICACHE_BYTES_STORED" ],
275- ValueFactory::getBigIntValue ());
286+ ValueFactory::getBigIntValue (m_totalBytesEvicted - m_totalBytesUnevicted ));
276287 tuple->setNValue (
277288 StatsSource::m_columnName2Index[" ANTICACHE_BLOCKS_FREE" ],
278- ValueFactory::getIntegerValue ());
289+ ValueFactory::getIntegerValue (m_currentFreeBlocks ));
279290 tuple->setNValue (
280291 StatsSource::m_columnName2Index[" ANTICACHE_BYTES_FREE" ],
281- ValueFactory::getBigIntValue ());
292+ ValueFactory::getBigIntValue (m_currentFreeBytes ));
282293
283294}
284295
@@ -294,6 +305,6 @@ void AntiCacheStats::populateSchema(
294305}
295306
296307AntiCacheStats::~AntiCacheStats () {
297- m_tableName.free ();
298- m_tableType.free ();
308+ // m_tableName.free();
309+ // m_tableType.free();
299310}
0 commit comments