accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1339311 - in /accumulo/trunk: ./ core/ core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java server/ src/
Date Wed, 16 May 2012 19:06:31 GMT
Author: vines
Date: Wed May 16 19:06:30 2012
New Revision: 1339311

URL: http://svn.apache.org/viewvc?rev=1339311&view=rev
Log:
Merging ACCUMULO-489


Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/src/   (props changed)

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src:r1339224-1339308
  Merged /accumulo/branches/1.4:r1339224-1339308

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/core:r1339224-1339308
  Merged /accumulo/branches/1.4/src/core:r1339224-1339308

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java?rev=1339311&r1=1339310&r2=1339311&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
Wed May 16 19:06:30 2012
@@ -108,10 +108,8 @@ public class AccumuloOutputFormat extend
    *          the output format will create new tables as necessary. Table names can only
be alpha-numeric and underscores.
    * @param defaultTable
    *          the table to use when the tablename is null in the write call
-   * @throws IOException
-   *           Thrown when there are issues creating the file distributed with the users
info
    */
-  public static void setOutputInfo(Configuration conf, String user, byte[] passwd, boolean
createTables, String defaultTable) throws IOException {
+  public static void setOutputInfo(Configuration conf, String user, byte[] passwd, boolean
createTables, String defaultTable) {
     if (conf.getBoolean(OUTPUT_INFO_HAS_BEEN_SET, false))
       throw new IllegalStateException("Output info can only be set once per job");
     conf.setBoolean(OUTPUT_INFO_HAS_BEEN_SET, true);
@@ -122,19 +120,23 @@ public class AccumuloOutputFormat extend
     if (defaultTable != null)
       conf.set(DEFAULT_TABLE_NAME, defaultTable);
     
-    FileSystem fs = FileSystem.get(conf);
-    Path file = new Path(fs.getWorkingDirectory(), conf.get("mapred.job.name") + System.currentTimeMillis()
+ ".pw");
-    conf.set(PASSWORD_PATH, file.toString());
-    FSDataOutputStream fos = fs.create(file, false);
-    fs.setPermission(file, new FsPermission(FsAction.ALL, FsAction.NONE, FsAction.NONE));
-    fs.deleteOnExit(file);
-    
-    byte[] encodedPw = Base64.encodeBase64(passwd);
-    fos.writeInt(encodedPw.length);
-    fos.write(encodedPw);
-    fos.close();
-    
-    DistributedCache.addCacheFile(file.toUri(), conf);
+    try {
+      FileSystem fs = FileSystem.get(conf);
+      Path file = new Path(fs.getWorkingDirectory(), conf.get("mapred.job.name") + System.currentTimeMillis()
+ ".pw");
+      conf.set(PASSWORD_PATH, file.toString());
+      FSDataOutputStream fos = fs.create(file, false);
+      fs.setPermission(file, new FsPermission(FsAction.ALL, FsAction.NONE, FsAction.NONE));
+      fs.deleteOnExit(file);
+      
+      byte[] encodedPw = Base64.encodeBase64(passwd);
+      fos.writeInt(encodedPw.length);
+      fos.write(encodedPw);
+      fos.close();
+      
+      DistributedCache.addCacheFile(file.toUri(), conf);
+    } catch (IOException ioe) {
+      throw new RuntimeException(ioe);
+    }
 
   }
   

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java?rev=1339311&r1=1339310&r2=1339311&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
Wed May 16 19:06:30 2012
@@ -184,9 +184,8 @@ public abstract class InputFormatBase<K,
    *          the table to read
    * @param auths
    *          the authorizations used to restrict data read
-   * @throws IOException
    */
-  public static void setInputInfo(Configuration conf, String user, byte[] passwd, String
table, Authorizations auths) throws IOException {
+  public static void setInputInfo(Configuration conf, String user, byte[] passwd, String
table, Authorizations auths) {
     if (conf.getBoolean(INPUT_INFO_HAS_BEEN_SET, false))
       throw new IllegalStateException("Input info can only be set once per job");
     conf.setBoolean(INPUT_INFO_HAS_BEEN_SET, true);
@@ -197,19 +196,24 @@ public abstract class InputFormatBase<K,
     if (auths != null && !auths.isEmpty())
       conf.set(AUTHORIZATIONS, auths.serialize());
     
-    FileSystem fs = FileSystem.get(conf);
-    Path file = new Path(fs.getWorkingDirectory(), conf.get("mapred.job.name") + System.currentTimeMillis()
+ ".pw");
-    conf.set(PASSWORD_PATH, file.toString());
-    FSDataOutputStream fos = fs.create(file, false);
-    fs.setPermission(file, new FsPermission(FsAction.ALL, FsAction.NONE, FsAction.NONE));
-    fs.deleteOnExit(file);
+    try {
+      FileSystem fs = FileSystem.get(conf);
+      Path file = new Path(fs.getWorkingDirectory(), conf.get("mapred.job.name") + System.currentTimeMillis()
+ ".pw");
+      conf.set(PASSWORD_PATH, file.toString());
+      FSDataOutputStream fos = fs.create(file, false);
+      fs.setPermission(file, new FsPermission(FsAction.ALL, FsAction.NONE, FsAction.NONE));
+      fs.deleteOnExit(file);
+      
+      byte[] encodedPw = Base64.encodeBase64(passwd);
+      fos.writeInt(encodedPw.length);
+      fos.write(encodedPw);
+      fos.close();
+      
+      DistributedCache.addCacheFile(file.toUri(), conf);
+    } catch (IOException ioe) {
+      throw new RuntimeException(ioe);
+    }
 
-    byte[] encodedPw = Base64.encodeBase64(passwd);
-    fos.writeInt(encodedPw.length);
-    fos.write(encodedPw);
-    fos.close();
-    
-    DistributedCache.addCacheFile(file.toUri(), conf);
   }
   
   /**

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/server:r1339224-1339308
  Merged /accumulo/branches/1.4/src/server:r1339224-1339308

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src:r1339224-1339308
  Merged /accumulo/branches/1.4/src/src:r1339224-1339308



Mime
View raw message