Search in sources :

Example 1 with LatestTableCountKey

use of io.datarouter.nodewatch.storage.latesttablecount.LatestTableCountKey in project datarouter by hotpads.

the class TableCountHandler method deleteAllMetadata.

@Handler
private Mav deleteAllMetadata(String clientName, String tableName) {
    // delete rows from TableCount
    var tableCountKeyPrefix = new TableCountKey(clientName, tableName, null);
    tableCountDao.deleteWithPrefix(tableCountKeyPrefix);
    // delete rows from TableSample
    var tableSampleKeyPrefix = new TableSampleKey(clientName, tableName, null, null);
    tableSampleDao.deleteWithPrefix(tableSampleKeyPrefix);
    // delete from LatestTableCount
    var latestTableCountKey = new LatestTableCountKey(clientName, tableName);
    latestTableCountDao.delete(latestTableCountKey);
    var dto = new DatarouterChangelogDtoBuilder("Nodewatch", clientName + "." + tableName, "deleted metadata", getSessionInfo().getNonEmptyUsernameOrElse("")).build();
    changelogRecorder.record(dto);
    return new InContextRedirectMav(request, paths.datarouter.nodewatch.tableCount.toSlashedString());
}
Also used : LatestTableCountKey(io.datarouter.nodewatch.storage.latesttablecount.LatestTableCountKey) InContextRedirectMav(io.datarouter.web.handler.mav.imp.InContextRedirectMav) TableCountKey(io.datarouter.nodewatch.storage.tablecount.TableCountKey) LatestTableCountKey(io.datarouter.nodewatch.storage.latesttablecount.LatestTableCountKey) TableSampleKey(io.datarouter.nodewatch.storage.tablesample.TableSampleKey) DatarouterChangelogDtoBuilder(io.datarouter.instrumentation.changelog.ChangelogRecorder.DatarouterChangelogDtoBuilder) BaseHandler(io.datarouter.web.handler.BaseHandler)

Aggregations

DatarouterChangelogDtoBuilder (io.datarouter.instrumentation.changelog.ChangelogRecorder.DatarouterChangelogDtoBuilder)1 LatestTableCountKey (io.datarouter.nodewatch.storage.latesttablecount.LatestTableCountKey)1 TableCountKey (io.datarouter.nodewatch.storage.tablecount.TableCountKey)1 TableSampleKey (io.datarouter.nodewatch.storage.tablesample.TableSampleKey)1 BaseHandler (io.datarouter.web.handler.BaseHandler)1 InContextRedirectMav (io.datarouter.web.handler.mav.imp.InContextRedirectMav)1