use of org.apache.tephra.Transaction.VisibilityLevel in project phoenix by apache.
the class TephraTransactionContext method getVisibilityLevel.
@Override
public PhoenixVisibilityLevel getVisibilityLevel() {
VisibilityLevel visibilityLevel = null;
Transaction tx = getCurrentTransaction();
assert (tx != null);
visibilityLevel = tx.getVisibilityLevel();
PhoenixVisibilityLevel phoenixVisibilityLevel;
switch(visibilityLevel) {
case SNAPSHOT:
phoenixVisibilityLevel = PhoenixVisibilityLevel.SNAPSHOT;
break;
case SNAPSHOT_EXCLUDE_CURRENT:
phoenixVisibilityLevel = PhoenixVisibilityLevel.SNAPSHOT_EXCLUDE_CURRENT;
break;
case SNAPSHOT_ALL:
phoenixVisibilityLevel = PhoenixVisibilityLevel.SNAPSHOT_ALL;
default:
phoenixVisibilityLevel = null;
}
return phoenixVisibilityLevel;
}
use of org.apache.tephra.Transaction.VisibilityLevel in project phoenix by apache.
the class TephraTransactionContext method setVisibilityLevel.
@Override
public void setVisibilityLevel(PhoenixVisibilityLevel visibilityLevel) {
VisibilityLevel tephraVisibilityLevel = null;
switch(visibilityLevel) {
case SNAPSHOT:
tephraVisibilityLevel = VisibilityLevel.SNAPSHOT;
break;
case SNAPSHOT_EXCLUDE_CURRENT:
tephraVisibilityLevel = VisibilityLevel.SNAPSHOT_EXCLUDE_CURRENT;
break;
case SNAPSHOT_ALL:
tephraVisibilityLevel = VisibilityLevel.SNAPSHOT_ALL;
break;
default:
assert (false);
}
Transaction tx = getCurrentTransaction();
assert (tx != null);
tx.setVisibility(tephraVisibilityLevel);
}
Aggregations