You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "DomGarguilo (via GitHub)" <gi...@apache.org> on 2023/03/23 16:20:28 UTC

[GitHub] [accumulo-examples] DomGarguilo opened a new pull request, #120: Replace instances of Text with String

DomGarguilo opened a new pull request, #120:
URL: https://github.com/apache/accumulo-examples/pull/120

   Fixes #12 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-examples] ctubbsii commented on a diff in pull request #120: Replace instances of Text with String

Posted by "ctubbsii (via GitHub)" <gi...@apache.org>.
ctubbsii commented on code in PR #120:
URL: https://github.com/apache/accumulo-examples/pull/120#discussion_r1146459697


##########
src/main/java/org/apache/accumulo/examples/dirlist/Ingest.java:
##########
@@ -68,17 +69,17 @@ public static Mutation buildMutation(ColumnVisibility cv, String path, boolean i
     if (path.equals("/"))
       path = "";
     Mutation m = new Mutation(QueryUtil.getRow(path));
-    Text colf;
+    String colf;
     if (isDir)
-      colf = QueryUtil.DIR_COLF;
+      colf = QueryUtil.DIR_COLF.toString();
     else
-      colf = new Text(encoder.encode(Long.MAX_VALUE - lastmod));
-    m.put(colf, new Text(LENGTH_CQ), cv, new Value(Long.toString(length).getBytes()));
-    m.put(colf, new Text(HIDDEN_CQ), cv, new Value(Boolean.toString(isHidden).getBytes()));
-    m.put(colf, new Text(EXEC_CQ), cv, new Value(Boolean.toString(canExec).getBytes()));
-    m.put(colf, new Text(LASTMOD_CQ), cv, new Value(Long.toString(lastmod).getBytes()));
+      colf = new String(encoder.encode(Long.MAX_VALUE - lastmod), StandardCharsets.UTF_8);

Review Comment:
   I think static imports for `UTF_8` (or other charsets) are better.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-examples] DomGarguilo merged pull request #120: Replace instances of Text with String

Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo merged PR #120:
URL: https://github.com/apache/accumulo-examples/pull/120


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-examples] DomGarguilo commented on a diff in pull request #120: Replace instances of Text with String

Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on code in PR #120:
URL: https://github.com/apache/accumulo-examples/pull/120#discussion_r1146464833


##########
src/main/java/org/apache/accumulo/examples/dirlist/Ingest.java:
##########
@@ -68,17 +69,17 @@ public static Mutation buildMutation(ColumnVisibility cv, String path, boolean i
     if (path.equals("/"))
       path = "";
     Mutation m = new Mutation(QueryUtil.getRow(path));
-    Text colf;
+    String colf;
     if (isDir)
-      colf = QueryUtil.DIR_COLF;
+      colf = QueryUtil.DIR_COLF.toString();
     else
-      colf = new Text(encoder.encode(Long.MAX_VALUE - lastmod));
-    m.put(colf, new Text(LENGTH_CQ), cv, new Value(Long.toString(length).getBytes()));
-    m.put(colf, new Text(HIDDEN_CQ), cv, new Value(Boolean.toString(isHidden).getBytes()));
-    m.put(colf, new Text(EXEC_CQ), cv, new Value(Boolean.toString(canExec).getBytes()));
-    m.put(colf, new Text(LASTMOD_CQ), cv, new Value(Long.toString(lastmod).getBytes()));
+      colf = new String(encoder.encode(Long.MAX_VALUE - lastmod), StandardCharsets.UTF_8);

Review Comment:
   Addressed in fc16eef



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org