Review Board 1.7.22


FLUME-1741 ElasticSearch tests leave directory data/elasticsearch/nodes/ lying around

Review Request #10251 - Created April 3, 2013 and updated

Jeff jlord
FLUME-1741
Reviewers
Flume
flume-git
Modify elastic search nodebuilder to clean up test directories.

 
flume-ng-sinks/flume-ng-elasticsearch-sink/src/test/java/org/apache/flume/sink/elasticsearch/AbstractElasticSearchSinkTest.java
Revision 6d472cf New Change
[20] 35 lines
[+20]
36
import org.apache.flume.channel.MemoryChannel;
36
import org.apache.flume.channel.MemoryChannel;
37
import org.apache.flume.conf.Configurables;
37
import org.apache.flume.conf.Configurables;
38
import org.elasticsearch.action.search.SearchResponse;
38
import org.elasticsearch.action.search.SearchResponse;
39
import org.elasticsearch.client.Client;
39
import org.elasticsearch.client.Client;
40
import org.elasticsearch.common.collect.Maps;
40
import org.elasticsearch.common.collect.Maps;

    
   
41
import org.elasticsearch.common.settings.ImmutableSettings;
41
import org.elasticsearch.gateway.Gateway;
42
import org.elasticsearch.gateway.Gateway;
42
import org.elasticsearch.index.query.QueryBuilder;
43
import org.elasticsearch.index.query.QueryBuilder;
43
import org.elasticsearch.index.query.QueryBuilders;
44
import org.elasticsearch.index.query.QueryBuilders;
44
import org.elasticsearch.node.Node;
45
import org.elasticsearch.node.Node;
45
import org.elasticsearch.node.NodeBuilder;
46
import org.elasticsearch.node.NodeBuilder;
[+20] [20] 23 lines
[+20]
69
    timestampedIndexName = DEFAULT_INDEX_NAME + "-"
70
    timestampedIndexName = DEFAULT_INDEX_NAME + "-"
70
        + ElasticSearchSink.df.format(new Date());
71
        + ElasticSearchSink.df.format(new Date());
71
  }
72
  }
72

    
   
73

   
73
  void createNodes() throws Exception {
74
  void createNodes() throws Exception {
74
    node = NodeBuilder.nodeBuilder().local(true).node();
75
    node = NodeBuilder.nodeBuilder().settings(ImmutableSettings.settingsBuilder().put("path.data", "target")).local(true).node();
75
    client = node.client();
76
    client = node.client();
76

    
   
77

   
77
    client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute()
78
    client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute()
78
        .actionGet();
79
        .actionGet();
79
  }
80
  }
[+20] [20] 54 lines
  1. flume-ng-sinks/flume-ng-elasticsearch-sink/src/test/java/org/apache/flume/sink/elasticsearch/AbstractElasticSearchSinkTest.java: Loading...