public abstract class SQLMetadataStorageActionHandler<EntryType,StatusType,LogType,LockType> extends Object implements MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>
| Constructor and Description |
|---|
SQLMetadataStorageActionHandler(SQLMetadataConnector connector,
com.fasterxml.jackson.databind.ObjectMapper jsonMapper,
MetadataStorageActionHandlerTypes<EntryType,StatusType,LogType,LockType> types,
String entryTypeName,
String entryTable,
String logTable,
String lockTable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addLock(String entryId,
LockType lock) |
boolean |
addLog(String entryId,
LogType log) |
protected abstract org.skife.jdbi.v2.Query<Map<String,Object>> |
createCompletedTaskInfoQuery(org.skife.jdbi.v2.Handle handle,
org.joda.time.DateTime timestamp,
Integer maxNumStatuses,
String dataSource) |
List<TaskInfo<EntryType,StatusType>> |
getActiveTaskInfo(String dataSource) |
List<TaskInfo<EntryType,StatusType>> |
getCompletedTaskInfo(org.joda.time.DateTime timestamp,
Integer maxNumStatuses,
String dataSource) |
protected SQLMetadataConnector |
getConnector() |
com.google.common.base.Optional<EntryType> |
getEntry(String entryId) |
protected String |
getEntryTable() |
com.fasterxml.jackson.core.type.TypeReference<EntryType> |
getEntryType() |
protected String |
getEntryTypeName() |
protected com.fasterxml.jackson.databind.ObjectMapper |
getJsonMapper() |
Long |
getLockId(String entryId,
LockType lock) |
Map<Long,LockType> |
getLocks(String entryId) |
List<LogType> |
getLogs(String entryId) |
protected String |
getLogTable() |
String |
getSqlRemoveLogsOlderThan()
Deprecated.
|
com.google.common.base.Optional<StatusType> |
getStatus(String entryId) |
protected com.fasterxml.jackson.core.type.TypeReference<StatusType> |
getStatusType() |
TaskInfo<EntryType,StatusType> |
getTaskInfo(String entryId) |
void |
insert(String id,
org.joda.time.DateTime timestamp,
String dataSource,
EntryType entry,
boolean active,
StatusType status) |
static boolean |
isStatementException(Throwable e) |
void |
removeLock(long lockId) |
void |
removeTasksOlderThan(long timestamp) |
boolean |
replaceLock(String entryId,
long oldLockId,
LockType newLock) |
boolean |
setStatus(String entryId,
boolean active,
StatusType status) |
public SQLMetadataStorageActionHandler(SQLMetadataConnector connector, com.fasterxml.jackson.databind.ObjectMapper jsonMapper, MetadataStorageActionHandlerTypes<EntryType,StatusType,LogType,LockType> types, String entryTypeName, String entryTable, String logTable, String lockTable)
protected SQLMetadataConnector getConnector()
protected com.fasterxml.jackson.databind.ObjectMapper getJsonMapper()
protected com.fasterxml.jackson.core.type.TypeReference<StatusType> getStatusType()
protected String getEntryTable()
protected String getLogTable()
protected String getEntryTypeName()
public com.fasterxml.jackson.core.type.TypeReference<EntryType> getEntryType()
public void insert(String id, org.joda.time.DateTime timestamp, String dataSource, EntryType entry, boolean active, StatusType status) throws EntryExistsException
insert in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>EntryExistsExceptionpublic static boolean isStatementException(Throwable e)
public boolean setStatus(String entryId, boolean active, StatusType status)
setStatus in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>public com.google.common.base.Optional<EntryType> getEntry(String entryId)
getEntry in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>public com.google.common.base.Optional<StatusType> getStatus(String entryId)
getStatus in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>@Nullable public TaskInfo<EntryType,StatusType> getTaskInfo(String entryId)
getTaskInfo in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>public List<TaskInfo<EntryType,StatusType>> getCompletedTaskInfo(org.joda.time.DateTime timestamp, @Nullable Integer maxNumStatuses, @Nullable String dataSource)
getCompletedTaskInfo in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>public List<TaskInfo<EntryType,StatusType>> getActiveTaskInfo(@Nullable String dataSource)
getActiveTaskInfo in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>protected abstract org.skife.jdbi.v2.Query<Map<String,Object>> createCompletedTaskInfoQuery(org.skife.jdbi.v2.Handle handle, org.joda.time.DateTime timestamp, @Nullable Integer maxNumStatuses, @Nullable String dataSource)
public boolean addLock(String entryId, LockType lock)
addLock in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>public boolean replaceLock(String entryId, long oldLockId, LockType newLock)
replaceLock in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>public void removeLock(long lockId)
removeLock in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>public void removeTasksOlderThan(long timestamp)
removeTasksOlderThan in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>public boolean addLog(String entryId, LogType log)
addLog in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>public List<LogType> getLogs(String entryId)
getLogs in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>@Deprecated public String getSqlRemoveLogsOlderThan()
public Map<Long,LockType> getLocks(String entryId)
getLocks in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>@Nullable public Long getLockId(String entryId, LockType lock)
getLockId in interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.