|
@@ -248,6 +248,11 @@ public class NMLeveldbStateStoreService extends NMStateStoreService {
|
|
|
@Override
|
|
|
public void storeContainer(ContainerId containerId,
|
|
|
StartContainerRequest startRequest) throws IOException {
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("storeContainer: containerId= " + containerId
|
|
|
+ + ", startRequest= " + startRequest);
|
|
|
+ }
|
|
|
+
|
|
|
String key = CONTAINERS_KEY_PREFIX + containerId.toString()
|
|
|
+ CONTAINER_REQUEST_KEY_SUFFIX;
|
|
|
try {
|
|
@@ -261,6 +266,11 @@ public class NMLeveldbStateStoreService extends NMStateStoreService {
|
|
|
@Override
|
|
|
public void storeContainerDiagnostics(ContainerId containerId,
|
|
|
StringBuilder diagnostics) throws IOException {
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("storeContainerDiagnostics: containerId=" + containerId
|
|
|
+ + ", diagnostics=" + diagnostics);
|
|
|
+ }
|
|
|
+
|
|
|
String key = CONTAINERS_KEY_PREFIX + containerId.toString()
|
|
|
+ CONTAINER_DIAGS_KEY_SUFFIX;
|
|
|
try {
|
|
@@ -273,6 +283,10 @@ public class NMLeveldbStateStoreService extends NMStateStoreService {
|
|
|
@Override
|
|
|
public void storeContainerLaunched(ContainerId containerId)
|
|
|
throws IOException {
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("storeContainerLaunched: containerId=" + containerId);
|
|
|
+ }
|
|
|
+
|
|
|
String key = CONTAINERS_KEY_PREFIX + containerId.toString()
|
|
|
+ CONTAINER_LAUNCHED_KEY_SUFFIX;
|
|
|
try {
|
|
@@ -285,6 +299,11 @@ public class NMLeveldbStateStoreService extends NMStateStoreService {
|
|
|
@Override
|
|
|
public void storeContainerResourceChanged(ContainerId containerId,
|
|
|
Resource capability) throws IOException {
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("storeContainerResourceChanged: containerId=" + containerId
|
|
|
+ + ", capability=" + capability);
|
|
|
+ }
|
|
|
+
|
|
|
String key = CONTAINERS_KEY_PREFIX + containerId.toString()
|
|
|
+ CONTAINER_RESOURCE_CHANGED_KEY_SUFFIX;
|
|
|
try {
|
|
@@ -299,6 +318,10 @@ public class NMLeveldbStateStoreService extends NMStateStoreService {
|
|
|
@Override
|
|
|
public void storeContainerKilled(ContainerId containerId)
|
|
|
throws IOException {
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("storeContainerKilled: containerId=" + containerId);
|
|
|
+ }
|
|
|
+
|
|
|
String key = CONTAINERS_KEY_PREFIX + containerId.toString()
|
|
|
+ CONTAINER_KILLED_KEY_SUFFIX;
|
|
|
try {
|
|
@@ -311,6 +334,10 @@ public class NMLeveldbStateStoreService extends NMStateStoreService {
|
|
|
@Override
|
|
|
public void storeContainerCompleted(ContainerId containerId,
|
|
|
int exitCode) throws IOException {
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("storeContainerCompleted: containerId=" + containerId);
|
|
|
+ }
|
|
|
+
|
|
|
String key = CONTAINERS_KEY_PREFIX + containerId.toString()
|
|
|
+ CONTAINER_EXIT_CODE_KEY_SUFFIX;
|
|
|
try {
|
|
@@ -323,6 +350,10 @@ public class NMLeveldbStateStoreService extends NMStateStoreService {
|
|
|
@Override
|
|
|
public void removeContainer(ContainerId containerId)
|
|
|
throws IOException {
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("removeContainer: containerId=" + containerId);
|
|
|
+ }
|
|
|
+
|
|
|
String keyPrefix = CONTAINERS_KEY_PREFIX + containerId.toString();
|
|
|
try {
|
|
|
WriteBatch batch = db.createWriteBatch();
|
|
@@ -389,6 +420,11 @@ public class NMLeveldbStateStoreService extends NMStateStoreService {
|
|
|
@Override
|
|
|
public void storeApplication(ApplicationId appId,
|
|
|
ContainerManagerApplicationProto p) throws IOException {
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("storeApplication: appId=" + appId
|
|
|
+ + ", proto=" + p);
|
|
|
+ }
|
|
|
+
|
|
|
String key = APPLICATIONS_KEY_PREFIX + appId;
|
|
|
try {
|
|
|
db.put(bytes(key), p.toByteArray());
|
|
@@ -400,6 +436,10 @@ public class NMLeveldbStateStoreService extends NMStateStoreService {
|
|
|
@Override
|
|
|
public void storeFinishedApplication(ApplicationId appId)
|
|
|
throws IOException {
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("storeFinishedApplication.appId: " + appId);
|
|
|
+ }
|
|
|
+
|
|
|
String key = FINISHED_APPS_KEY_PREFIX + appId;
|
|
|
try {
|
|
|
db.put(bytes(key), new byte[0]);
|
|
@@ -411,6 +451,10 @@ public class NMLeveldbStateStoreService extends NMStateStoreService {
|
|
|
@Override
|
|
|
public void removeApplication(ApplicationId appId)
|
|
|
throws IOException {
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("removeApplication: appId=" + appId);
|
|
|
+ }
|
|
|
+
|
|
|
try {
|
|
|
WriteBatch batch = db.createWriteBatch();
|
|
|
try {
|