Skip to content

Commit

Permalink
Add Drift serialization compatibility for NodeStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
tdcmeehan committed Apr 19, 2021
1 parent 3ab2e8e commit b1306fc
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
package com.facebook.presto.metadata;

import com.facebook.drift.annotations.ThriftConstructor;
import com.facebook.drift.annotations.ThriftEnum;
import com.facebook.drift.annotations.ThriftEnumValue;
import com.facebook.drift.annotations.ThriftField;
import com.facebook.drift.annotations.ThriftStruct;
import com.facebook.presto.client.NodeVersion;
Expand All @@ -36,10 +38,25 @@
public class InternalNode
implements Node
{
@ThriftEnum
public enum NodeStatus
{
ALIVE,
DEAD
ALIVE(1),
DEAD(2),
/**/;

private final int statusCode;

NodeStatus(int statusCode)
{
this.statusCode = statusCode;
}

@ThriftEnumValue
public int getStatusCode()
{
return statusCode;
}
}

private final String nodeIdentifier;
Expand Down

0 comments on commit b1306fc

Please sign in to comment.