Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-22258 Removed deprecated methods in VisibilityClient #159

Merged
merged 1 commit into from
Apr 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@
import java.util.Map;
import java.util.regex.Pattern;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.client.coprocessor.Batch;
import org.apache.hadoop.hbase.client.security.SecurityCapability;
Expand Down Expand Up @@ -66,23 +64,6 @@ public static boolean isCellVisibilityEnabled(Connection connection) throws IOEx
.contains(SecurityCapability.CELL_VISIBILITY);
}

/**
* Utility method for adding label to the system.
*
* @param conf
* @param label
* @return VisibilityLabelsResponse
* @throws Throwable
* @deprecated Use {@link #addLabel(Connection,String)} instead.
*/
@Deprecated
public static VisibilityLabelsResponse addLabel(Configuration conf, final String label)
throws Throwable {
try (Connection connection = ConnectionFactory.createConnection(conf)) {
return addLabels(connection, new String[] { label });
}
}

/**
* Utility method for adding label to the system.
*
Expand All @@ -96,23 +77,6 @@ public static VisibilityLabelsResponse addLabel(Connection connection, final Str
return addLabels(connection, new String[] { label });
}

/**
* Utility method for adding labels to the system.
*
* @param conf
* @param labels
* @return VisibilityLabelsResponse
* @throws Throwable
* @deprecated Use {@link #addLabels(Connection,String[])} instead.
*/
@Deprecated
public static VisibilityLabelsResponse addLabels(Configuration conf, final String[] labels)
throws Throwable {
try (Connection connection = ConnectionFactory.createConnection(conf)) {
return addLabels(connection, labels);
}
}

/**
* Utility method for adding labels to the system.
*
Expand Down Expand Up @@ -156,23 +120,6 @@ public VisibilityLabelsResponse call(VisibilityLabelsService service) throws IOE
}
}

/**
* Sets given labels globally authorized for the user.
* @param conf
* @param auths
* @param user
* @return VisibilityLabelsResponse
* @throws Throwable
* @deprecated Use {@link #setAuths(Connection,String[],String)} instead.
*/
@Deprecated
public static VisibilityLabelsResponse setAuths(Configuration conf, final String[] auths,
final String user) throws Throwable {
try (Connection connection = ConnectionFactory.createConnection(conf)) {
return setOrClearAuths(connection, auths, user, true);
}
}

/**
* Sets given labels globally authorized for the user.
* @param connection
Expand All @@ -186,20 +133,6 @@ public static VisibilityLabelsResponse setAuths(Connection connection, final Str
return setOrClearAuths(connection, auths, user, true);
}

/**
* @param conf
* @param user
* @return labels, the given user is globally authorized for.
* @throws Throwable
* @deprecated Use {@link #getAuths(Connection,String)} instead.
*/
@Deprecated
public static GetAuthsResponse getAuths(Configuration conf, final String user) throws Throwable {
try (Connection connection = ConnectionFactory.createConnection(conf)) {
return getAuths(connection, user);
}
}

/**
* @param connection the Connection instance to use.
* @param user
Expand Down Expand Up @@ -235,22 +168,6 @@ public GetAuthsResponse call(VisibilityLabelsService service) throws IOException
}
}

/**
* Retrieve the list of visibility labels defined in the system.
* @param conf
* @param regex The regular expression to filter which labels are returned.
* @return labels The list of visibility labels defined in the system.
* @throws Throwable
* @deprecated Use {@link #listLabels(Connection,String)} instead.
*/
@Deprecated
public static ListLabelsResponse listLabels(Configuration conf, final String regex)
throws Throwable {
try(Connection connection = ConnectionFactory.createConnection(conf)){
return listLabels(connection, regex);
}
}

/**
* Retrieve the list of visibility labels defined in the system.
* @param connection The Connection instance to use.
Expand Down Expand Up @@ -291,23 +208,6 @@ public ListLabelsResponse call(VisibilityLabelsService service) throws IOExcepti
}
}

/**
* Removes given labels from user's globally authorized list of labels.
* @param conf
* @param auths
* @param user
* @return VisibilityLabelsResponse
* @throws Throwable
* @deprecated Use {@link #clearAuths(Connection,String[],String)} instead.
*/
@Deprecated
public static VisibilityLabelsResponse clearAuths(Configuration conf, final String[] auths,
final String user) throws Throwable {
try (Connection connection = ConnectionFactory.createConnection(conf)) {
return setOrClearAuths(connection, auths, user, false);
}
}

/**
* Removes given labels from user's globally authorized list of labels.
* @param connection
Expand Down