You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/04/07 01:48:16 UTC
[GitHub] [accumulo] drewfarris opened a new pull request #1579: Closes
#1576: Update importTable with directory list as Set
drewfarris opened a new pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] keith-turner commented on a change in pull request
#1579: Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
keith-turner commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r405774399
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -177,10 +177,25 @@ void create(String tableName, NewTableConfiguration ntc)
* @param tableName
* Name of a table to create and import into.
* @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * A directory containing the files copied by distcp from exportTable
* @since 1.5.0
+ *
+ */
+ default void importTable(String tableName, String importDir)
+ throws TableExistsException, AccumuloException, AccumuloSecurityException {
+ importTable(tableName, Set.of(importDir));
+ }
+
+ /**
+ * Imports a table exported via exportTable and copied via hadoop distcp.
+ *
+ * @param tableName
+ * Name of a table to create and import into.
+ * @param importDirs
+ * A set of directories containing the files copied by distcp from exportTable
Review comment:
Is there anything that would be worth mentioning about the metadata zip file and multiple dirs here?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r405008459
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,27 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A comma-delimited list of directories containing the files copied by distcp from
+ * exportTable
* @since 1.5.0
+ *
+ * @deprecated since 2.1.0 use {@link #importTable(String, Set)} instead.
+ */
+ @Deprecated
Review comment:
> Hmm, I don't understand why adding a new method eliminates the need for deprecation.
The deprecation has nothing to do with the addition of the new method. It pertains to the removal of the old method.
> The idea here would be to remove the original `importTable(String, String)` at some point when it is safe to do so.
If you think it's better to remove the old method, that's fine and it should be deprecated. It's just not a requirement to remove it.
> `@Deprecated(since="2.1.0",forRemoval=true)`
If it is going to be deprecated, I agree it should be marked this way. I don't think we ever want to deprecate something and still retain it forever. The reason we deprecate stuff is so we can purge it (eventually). I wish `forRemoval=true` were default when they added this, because that's how I've always interpreted `@Deprecated`, but I recognize others may interpret it differently.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] drewfarris commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
drewfarris commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r405559383
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,27 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A comma-delimited list of directories containing the files copied by distcp from
+ * exportTable
* @since 1.5.0
+ *
+ * @deprecated since 2.1.0 use {@link #importTable(String, Set)} instead.
+ */
+ @Deprecated
Review comment:
>That is a good goal, not sure whats best in the big scheme of things.
Ok, thanks for explaining your perspective. The makes a great deal of sense. Based on this, I'm going to avoid deprecating the original method. It looks like theres precedent for `default` implementations in the `TableOperations` interface, so I'll proceed in that way.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404948537
##########
File path: server/master/src/main/java/org/apache/accumulo/master/tableOps/tableImport/ImportedTableInfo.java
##########
@@ -38,6 +38,10 @@
static class DirectoryMapping implements Serializable {
private static final long serialVersionUID = 1L;
+ public DirectoryMapping(String exportDir) {
+ this.exportDir = exportDir;
Review comment:
Since the `exportDir` is set in the constructor, can we now make the field `final`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404951306
##########
File path: test/src/main/java/org/apache/accumulo/test/ImportExportIT.java
##########
@@ -151,7 +151,8 @@ public void testExportImportThenScan() throws Exception {
log.info("Import dir B: {}", Arrays.toString(fs.listStatus(importDirB)));
// Import the exported data into a new table
- client.tableOperations().importTable(destTable, importDirDlm);
+ client.tableOperations().importTable(destTable,
+ Set.of(importDirA.toString(), importDirB.toString()));
Review comment:
If you define this set earlier, you wouldn't need to manually concatenate them for the log message, because you could just rely on `Set.toString()`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] drewfarris commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
drewfarris commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404976405
##########
File path: server/master/src/main/java/org/apache/accumulo/master/tableOps/tableImport/ImportTable.java
##########
@@ -19,13 +19,14 @@
package org.apache.accumulo.master.tableOps.tableImport;
import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.util.function.Predicate.not;
Review comment:
@ctubbsii @keith-turner - `Predicate.not` was added in Java 11 and I expected the build to fail when I used it, but it didn't. What runtimes are we supporting for 2.1.x?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404938085
##########
File path: core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
##########
@@ -1544,22 +1544,29 @@ public static Path findExportFile(ClientContext context, List<String> importDirs
@Override
public void importTable(String tableName, String importDir)
throws TableExistsException, AccumuloException, AccumuloSecurityException {
+ importTable(tableName, Set.of(importDir.split(",")));
+ }
+
+ @Override
+ public void importTable(String tableName, Set<String> importDirs)
+ throws TableExistsException, AccumuloException, AccumuloSecurityException {
checkArgument(tableName != null, "tableName is null");
- checkArgument(importDir != null, "importDir is null");
+ checkArgument(importDirs != null, "importDir is null");
checkArgument(tableName.length() <= MAX_TABLE_NAME_LEN,
"Table name is longer than " + MAX_TABLE_NAME_LEN + " characters");
- List<String> importDirs = new ArrayList<>();
- for (String dir : importDir.split(",")) {
- try {
- importDirs.add(checkPath(dir, "Table", "").toString());
- } catch (IOException e) {
- throw new AccumuloException(e);
+ Set<String> checkedImportDirs = new HashSet<String>();
+ try {
+ for (String s : importDirs) {
+ checkedImportDirs.add(checkPath(s, "Table", "").toString());
}
+ } catch (IOException e) {
+ throw new AccumuloException(e);
}
+ String normedImportDir = StringUtils.join(checkedImportDirs, ",");
Review comment:
This isn't used.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] drewfarris commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
drewfarris commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404870758
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,11 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A set of directories containing the files copied by distcp from exportTable
* @since 1.5.0
*/
- void importTable(String tableName, String importDir)
+ void importTable(String tableName, Set<String> importDirs)
Review comment:
I took a crack at this in 7f241a70c3be2d0d5c5b4159684fc5d6646bdcc7 - let me know if this is sufficient.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r405008459
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,27 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A comma-delimited list of directories containing the files copied by distcp from
+ * exportTable
* @since 1.5.0
+ *
+ * @deprecated since 2.1.0 use {@link #importTable(String, Set)} instead.
+ */
+ @Deprecated
Review comment:
> Hmm, I don't understand why adding a new method eliminates the need for deprecation.
The deprecation has nothing to do with the addition of the new method. It pertains to the removal of the old method.
> The idea here would be to remove the original `importTable(String, String)` at some point when it is safe to do so.
If you think it's better to remove the old method, that's fine and it should be deprecated. It's just not a requirement to remove it.
> @Deprecated(since="2.1.0",forRemoval=true)
If it is going to be deprecated, I agree it should be marked this way. I don't think we ever want to deprecate something and still retain it forever. The reason we deprecate stuff is so we can purge it (eventually). I wish `forRemoval=true` were default when they added this, because that's how I've always interpreted `@Deprecated`, but I recognize others may interpret it differently.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] keith-turner commented on a change in pull request
#1579: Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
keith-turner commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r405089447
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,27 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A comma-delimited list of directories containing the files copied by distcp from
+ * exportTable
* @since 1.5.0
+ *
+ * @deprecated since 2.1.0 use {@link #importTable(String, Set)} instead.
+ */
+ @Deprecated
Review comment:
> I suppose I'm in favor of keeping the number of public api methods to a minimum
That is a good goal, not sure whats best in the big scheme of things. In my experience removing methods is most painful for indirect users of Accumulo (like someone using Accumulo via something like Rya). Can get into a situation where you can not use the latest version of Accumulo w/o patching and rebuilding Rya.
Could minimize clutter in the Accumulo source using a default method in the interface for the existing method (that calls the new method) and have it nowhere else.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404939563
##########
File path: core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
##########
@@ -1544,22 +1544,29 @@ public static Path findExportFile(ClientContext context, List<String> importDirs
@Override
public void importTable(String tableName, String importDir)
throws TableExistsException, AccumuloException, AccumuloSecurityException {
+ importTable(tableName, Set.of(importDir.split(",")));
+ }
+
+ @Override
+ public void importTable(String tableName, Set<String> importDirs)
+ throws TableExistsException, AccumuloException, AccumuloSecurityException {
checkArgument(tableName != null, "tableName is null");
- checkArgument(importDir != null, "importDir is null");
+ checkArgument(importDirs != null, "importDir is null");
checkArgument(tableName.length() <= MAX_TABLE_NAME_LEN,
"Table name is longer than " + MAX_TABLE_NAME_LEN + " characters");
- List<String> importDirs = new ArrayList<>();
- for (String dir : importDir.split(",")) {
- try {
- importDirs.add(checkPath(dir, "Table", "").toString());
- } catch (IOException e) {
- throw new AccumuloException(e);
+ Set<String> checkedImportDirs = new HashSet<String>();
+ try {
+ for (String s : importDirs) {
+ checkedImportDirs.add(checkPath(s, "Table", "").toString());
}
+ } catch (IOException e) {
+ throw new AccumuloException(e);
}
+ String normedImportDir = StringUtils.join(checkedImportDirs, ",");
try {
- Path exportFilePath = findExportFile(context, importDirs);
+ Path exportFilePath = findExportFile(context, checkedImportDirs);
Review comment:
Since the variable was renamed, there are other places below that need to be changed from `importDirs` to `checkedImportDirs` as well.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] drewfarris commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
drewfarris commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r405063506
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,27 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A comma-delimited list of directories containing the files copied by distcp from
+ * exportTable
* @since 1.5.0
+ *
+ * @deprecated since 2.1.0 use {@link #importTable(String, Set)} instead.
+ */
+ @Deprecated
Review comment:
> I was just thinking that adding the new method does not necessitate deprecating the existing one. The existing method is not broken in any way, it still satisfies its original functionality for anyone who invested the time to write code against it in the past.
I'm happy to go either way. I suppose I'm in favor of keeping the number of public api methods to a minimum, but I don't feel strongly about leaving the existing method around if that's a better fit for the project.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r405129496
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,27 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A comma-delimited list of directories containing the files copied by distcp from
+ * exportTable
Review comment:
This javadoc is no longer true.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] drewfarris merged pull request #1579: Closes #1576:
Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
drewfarris merged pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404945319
##########
File path: server/master/src/main/java/org/apache/accumulo/master/tableOps/tableImport/ImportTable.java
##########
@@ -53,16 +54,17 @@
public class ImportTable extends MasterRepo {
private static final Logger log = LoggerFactory.getLogger(ImportTable.class);
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
Review comment:
Since the Fate serialization has changed, it will be very important that there are no outstanding import table fate operations outstanding before upgrading. I suspect this is unlikely for most people, but may be something to call out in the release notes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404952511
##########
File path: test/src/main/java/org/apache/accumulo/test/NamespacesIT.java
##########
@@ -980,8 +980,8 @@ public void verifyTableOperationsExceptions() throws Exception {
() -> ops.clone("a", tableName, true, Collections.emptyMap(), Collections.emptySet()));
ops.offline("a", true);
ops.exportTable("a", System.getProperty("user.dir") + "/target");
- assertAccumuloExceptionNoNamespace(
- () -> ops.importTable(tableName, System.getProperty("user.dir") + "/target"));
+ assertAccumuloExceptionNoNamespace(() -> ops.importTable(tableName,
+ Collections.singleton(System.getProperty("user.dir") + "/target")));
Review comment:
`Set.of(X)` is shorter than `Collections.singleton(X)`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404495656
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,11 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A set of directories containing the files copied by distcp from exportTable
* @since 1.5.0
*/
- void importTable(String tableName, String importDir)
+ void importTable(String tableName, Set<String> importDirs)
Review comment:
This is public API and cannot change without a deprecation cycle.
A new API is needed, which should co-exist with this one, until this one is removed.
I didn't look at the rest of this PR, since this is a blocker right away.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] keith-turner commented on a change in pull request
#1579: Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
keith-turner commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404926634
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,27 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A comma-delimited list of directories containing the files copied by distcp from
+ * exportTable
* @since 1.5.0
+ *
+ * @deprecated since 2.1.0 use {@link #importTable(String, Set)} instead.
+ */
+ @Deprecated
Review comment:
This does not have to be deprecated because a new method was added. Also, do you want the method to be removed in the future? Starting with Java 9, two parameters were added to the deprecated annotation `since` and `forRemoval`. The default for `forRemoval` is false. If deprecating, it may also be good explicitly set these. Not sure if my syntax is correct below, I have not used these yet.
```suggestion
@Deprecated(since="2.1.0",forRemoval=false)
```
Personally, I don't think the method needs to be deprecated.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] keith-turner commented on a change in pull request
#1579: Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
keith-turner commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r405047900
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,27 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A comma-delimited list of directories containing the files copied by distcp from
+ * exportTable
* @since 1.5.0
+ *
+ * @deprecated since 2.1.0 use {@link #importTable(String, Set)} instead.
+ */
+ @Deprecated
Review comment:
> Hmm, I don't understand why adding a new method eliminates the need for deprecation.
I was just thinking that adding the new method does not necessitate deprecating the existing one. The existing method is not broken in any way, it still satisfies its original functionality for anyone who invested the time to write code against it in the past.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] keith-turner commented on a change in pull request
#1579: Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
keith-turner commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404915203
##########
File path: core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
##########
@@ -1544,22 +1544,29 @@ public static Path findExportFile(ClientContext context, List<String> importDirs
@Override
public void importTable(String tableName, String importDir)
throws TableExistsException, AccumuloException, AccumuloSecurityException {
+ importTable(tableName, Set.of(importDir.split(",")));
Review comment:
Maybe the existing API should maintain its current behavior and only support a single dir. This avoids any surprises for existing code. If someone wants to use the new functionality, they need to use the new API.
```suggestion
importTable(tableName, Set.of(importDir));
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r405591496
##########
File path: core/src/test/java/org/apache/accumulo/core/clientImpl/TableOperationsHelperTest.java
##########
@@ -199,6 +199,9 @@ public void clearLocatorCache(String tableName) {}
@Override
public void importTable(String tableName, String exportDir) {}
Review comment:
If you're using a default method in the interface, the corresponding methods can be deleted from the implementing classes. I would check all subclasses and remove any that aren't needed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] drewfarris commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
drewfarris commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404990378
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,27 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A comma-delimited list of directories containing the files copied by distcp from
+ * exportTable
* @since 1.5.0
+ *
+ * @deprecated since 2.1.0 use {@link #importTable(String, Set)} instead.
+ */
+ @Deprecated
Review comment:
> This does not have to be deprecated because a new method was added.
Hmm, I don't understand why adding a new method eliminates the need for deprecation. The idea here would be to remove the original `importTable(String, String)` at some point when it is safe to do so.
Thanks for mentioning the Java 9 parameters. As such, I suspect the right annotation would be:
```
@Deprecated(since="2.1.0",forRemoval=true)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] keith-turner commented on a change in pull request
#1579: Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
keith-turner commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r405775512
##########
File path: server/master/src/main/java/org/apache/accumulo/master/tableOps/tableImport/ImportTable.java
##########
@@ -53,16 +54,17 @@
public class ImportTable extends MasterRepo {
private static final Logger log = LoggerFactory.getLogger(ImportTable.class);
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
Review comment:
I think we check before upgrade if there are any outstanding FATE ops and if so upgrade will not proceed. So usually do not need to worry about FATE persistence across versions.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r405129769
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,27 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A comma-delimited list of directories containing the files copied by distcp from
+ * exportTable
* @since 1.5.0
+ *
+ * @deprecated since 2.1.0 use {@link #importTable(String, Set)} instead.
+ */
+ @Deprecated(since = "2.1.0", forRemoval = true)
+ void importTable(String tableName, String importDirs)
Review comment:
I think this should be singular "importDir" now (or whatever it was called before the changes in #1060 )
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r405009765
##########
File path: server/master/src/main/java/org/apache/accumulo/master/tableOps/tableImport/ImportTable.java
##########
@@ -19,13 +19,14 @@
package org.apache.accumulo.master.tableOps.tableImport;
import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.util.function.Predicate.not;
Review comment:
2.1 is targeting Java 11.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404935610
##########
File path: core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
##########
@@ -176,11 +176,27 @@ void create(String tableName, NewTableConfiguration ntc)
*
* @param tableName
* Name of a table to create and import into.
- * @param importDir
- * Directory that contains the files copied by distcp from exportTable
+ * @param importDirs
+ * A comma-delimited list of directories containing the files copied by distcp from
+ * exportTable
* @since 1.5.0
+ *
+ * @deprecated since 2.1.0 use {@link #importTable(String, Set)} instead.
+ */
+ @Deprecated
Review comment:
I don't care whether it is deprecated or not, but would prefer the original method keep the behavior from before #1060 ; I think it's fine if not.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [accumulo] ctubbsii commented on a change in pull request #1579:
Closes #1576: Update importTable with directory list as Set
Posted by GitBox <gi...@apache.org>.
ctubbsii commented on a change in pull request #1579: Closes #1576: Update importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404934986
##########
File path: core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
##########
@@ -1544,22 +1544,29 @@ public static Path findExportFile(ClientContext context, List<String> importDirs
@Override
public void importTable(String tableName, String importDir)
throws TableExistsException, AccumuloException, AccumuloSecurityException {
+ importTable(tableName, Set.of(importDir.split(",")));
Review comment:
:+1: I had the same thought.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services