hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r750580 - in /hadoop/core/trunk/src/contrib/chukwa: ./ src/test/org/apache/hadoop/chukwa/datacollection/ src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/ src/test/org/apache/hadoop/chukwa/extraction/demux/ src/test/org/a...
Date Thu, 05 Mar 2009 20:45:51 GMT
Author: asrabkin
Date: Thu Mar  5 20:45:50 2009
New Revision: 750580

URL: http://svn.apache.org/viewvc?rev=750580&view=rev
Log:
HADOOP-5228.  Chukwa tests shouldn't write to /tmp. 

Modified:
    hadoop/core/trunk/src/contrib/chukwa/CHANGES.txt
    hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/TempFileUtil.java
    hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestCharFileTailingAdaptorUTF8.java
    hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptors.java
    hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestLogRotate.java
    hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestRawAdaptor.java
    hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestStartAtOffset.java
    hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/extraction/demux/TestDemux.java
    hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TestHadoopLogProcessor.java

Modified: hadoop/core/trunk/src/contrib/chukwa/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/CHANGES.txt?rev=750580&r1=750579&r2=750580&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/CHANGES.txt (original)
+++ hadoop/core/trunk/src/contrib/chukwa/CHANGES.txt Thu Mar  5 20:45:50 2009
@@ -10,6 +10,7 @@
 
     HADOOP-5370   Collectors don't write empty sink files (asrabkin)
 
+    HADOOP-5228   Chukwa tests shouldn't write to /tmp. (asrabkin)
 	
   OPTIMIZATIONS
 

Modified: hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/TempFileUtil.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/TempFileUtil.java?rev=750580&r1=750579&r2=750580&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/TempFileUtil.java
(original)
+++ hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/TempFileUtil.java
Thu Mar  5 20:45:50 2009
@@ -23,7 +23,7 @@
 
 public class TempFileUtil {
   public static File makeBinary(int length) throws IOException {
-    File tmpOutput = new File("/tmp/chukwaTest");
+    File tmpOutput = new File(System.getProperty("test.build.data", "/tmp"),"chukwaTest");
     FileOutputStream fos = new FileOutputStream(tmpOutput);
     Random r = new Random();
     byte[] randomData = new byte[ length];

Modified: hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestCharFileTailingAdaptorUTF8.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestCharFileTailingAdaptorUTF8.java?rev=750580&r1=750579&r2=750580&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestCharFileTailingAdaptorUTF8.java
(original)
+++ hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestCharFileTailingAdaptorUTF8.java
Thu Mar  5 20:45:50 2009
@@ -22,7 +22,7 @@
   public void testCrSepAdaptor() throws IOException, InterruptedException,
       ChukwaAgent.AlreadyRunningException {
     ChukwaAgent agent = new ChukwaAgent();
-    File testFile = makeTestFile("/tmp/chukwaTest", 80);
+    File testFile = makeTestFile("chukwaTest", 80);
     long adaptorId = agent
         .processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
             + " lines " + testFile + " 0");
@@ -47,7 +47,7 @@
   }
 
   private File makeTestFile(String name, int size) throws IOException {
-    File tmpOutput = new File(name);
+    File tmpOutput = new File(System.getProperty("test.build.data", "/tmp"), name);
     FileOutputStream fos = new FileOutputStream(tmpOutput);
 
     PrintWriter pw = new PrintWriter(fos);

Modified: hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptors.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptors.java?rev=750580&r1=750579&r2=750580&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptors.java
(original)
+++ hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestFileTailingAdaptors.java
Thu Mar  5 20:45:50 2009
@@ -46,7 +46,7 @@
     cli.removeAll();
     // sleep for some time to make sure we don't get chunk from existing streams
     Thread.sleep(5000);
-    File testFile = makeTestFile("/tmp/chukwaCrSepTest",80);
+    File testFile = makeTestFile("chukwaCrSepTest",80);
     long adaptorId = agent.processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
+
         " lines " + testFile + " 0");
     assertTrue(adaptorId != -1);
@@ -71,7 +71,7 @@
   }
 
   private File makeTestFile(String name, int size) throws IOException {
-    File tmpOutput = new File(name);
+    File tmpOutput = new File(System.getProperty("test.build.data", "/tmp"),name);
     FileOutputStream fos = new FileOutputStream(tmpOutput);
     
     PrintWriter pw = new PrintWriter(fos);

Modified: hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestLogRotate.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestLogRotate.java?rev=750580&r1=750579&r2=750580&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestLogRotate.java
(original)
+++ hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestLogRotate.java
Thu Mar  5 20:45:50 2009
@@ -46,7 +46,7 @@
     cli.removeAll();
     // sleep for some time to make sure we don't get chunk from existing streams
     Thread.sleep(5000);
-    File testFile = makeTestFile("/tmp/chukwaLogRotateTest",80);
+    File testFile = makeTestFile("chukwaLogRotateTest",80);
     long adaptorId = agent.processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
+
         " lines " + testFile + " 0");
     assertTrue(adaptorId != -1);
@@ -66,7 +66,7 @@
       recStart = c.getRecordOffsets()[rec] +1;
     }
     assertTrue(c.getDataType().equals("lines"));
-    testFile = makeTestFile("/tmp/chukwaLogRotateTest",40);
+    testFile = makeTestFile("chukwaLogRotateTest",40);
     c = chunks.waitForAChunk(); 
     System.out.println("got chunk");
     while(!c.getDataType().equals("lines")) {
@@ -87,7 +87,7 @@
   }
 
   private File makeTestFile(String name, int size) throws IOException {
-    File tmpOutput = new File(name);
+    File tmpOutput = new File(System.getProperty("test.build.data", "/tmp"),name);
     FileOutputStream fos = new FileOutputStream(tmpOutput);
     
     PrintWriter pw = new PrintWriter(fos);

Modified: hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestRawAdaptor.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestRawAdaptor.java?rev=750580&r1=750579&r2=750580&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestRawAdaptor.java
(original)
+++ hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestRawAdaptor.java
Thu Mar  5 20:45:50 2009
@@ -47,7 +47,7 @@
     cli.removeAll();
     // sleep for some time to make sure we don't get chunk from existing streams
     Thread.sleep(5000);
-    File testFile = makeTestFile("/tmp/chukwaRawTest",80);
+    File testFile = makeTestFile("chukwaRawTest",80);
     long adaptorId = agent.processCommand("add org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.FileTailingAdaptor"
+
         " raw " + testFile + " 0");
     assertTrue(adaptorId != -1);
@@ -63,7 +63,7 @@
   }
 
   private File makeTestFile(String name, int size) throws IOException {
-    File tmpOutput = new File(name);
+    File tmpOutput = new File(System.getProperty("test.build.data", "/tmp"),name);
     FileOutputStream fos = new FileOutputStream(tmpOutput);
     
     PrintWriter pw = new PrintWriter(fos);

Modified: hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestStartAtOffset.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestStartAtOffset.java?rev=750580&r1=750579&r2=750580&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestStartAtOffset.java
(original)
+++ hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/datacollection/adaptor/filetailer/TestStartAtOffset.java
Thu Mar  5 20:45:50 2009
@@ -110,7 +110,7 @@
   }
   
   private File makeTestFile() throws IOException {
-    File tmpOutput = new File("/tmp/chukwaTest");
+    File tmpOutput = new File(System.getProperty("test.build.data", "/tmp"), "chukwaTest");
     FileOutputStream fos = new FileOutputStream(tmpOutput);
     
     PrintWriter pw = new PrintWriter(fos);

Modified: hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/extraction/demux/TestDemux.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/extraction/demux/TestDemux.java?rev=750580&r1=750579&r2=750580&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/extraction/demux/TestDemux.java
(original)
+++ hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/extraction/demux/TestDemux.java
Thu Mar  5 20:45:50 2009
@@ -95,7 +95,7 @@
     try{
       System.out.println("testing demux");
       Configuration conf = new Configuration();
-      System.setProperty("hadoop.log.dir", "/tmp/");
+      System.setProperty("hadoop.log.dir", System.getProperty("test.build.data", "/tmp"));
       MiniDFSCluster dfs = new MiniDFSCluster(conf, NUM_HADOOP_SLAVES, true, null);
       FileSystem fileSys = dfs.getFileSystem();
       MiniMRCluster mr = new MiniMRCluster(NUM_HADOOP_SLAVES, fileSys.getUri().toString(),
1);

Modified: hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TestHadoopLogProcessor.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TestHadoopLogProcessor.java?rev=750580&r1=750579&r2=750580&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TestHadoopLogProcessor.java
(original)
+++ hadoop/core/trunk/src/contrib/chukwa/src/test/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TestHadoopLogProcessor.java
Thu Mar  5 20:45:50 2009
@@ -75,18 +75,5 @@
     return c;
   }
   
-  /*
-  public File writeATestFile(int lines) throws IOException {
-    File output = new File("/tmp/hlpparsetest");
-    FileOutputStream fos = new FileOutputStream(output);
-    PrintStream out = new PrintStream(fos);
-    
-    for(int i =0; i < lines; ++i) {
-      out.println("2008-05-29 10:42:22,724 INFO org.apache.hadoop.dfs.DataNode: Some text
goes here" +i);
-  
-    }
-    out.close();
-    return output;
-  }*/
 }
 



Mime
View raw message