Esempio n. 1
0
 /*
  * An unfortunate test only method for supplying a mock source
  */
 public void addDataSource(ExportDataSource source) {
   HashMap<String, ExportDataSource> dataSourcesForPartition =
       m_dataSourcesByPartition.get(source.getPartitionId());
   if (dataSourcesForPartition == null) {
     dataSourcesForPartition = new HashMap<String, ExportDataSource>();
     m_dataSourcesByPartition.put(source.getPartitionId(), dataSourcesForPartition);
   }
   dataSourcesForPartition.put(source.getSignature(), source);
 }
Esempio n. 2
0
 /*
  * Create a datasource based on an ad file
  */
 private void addDataSource(File adFile, Set<Integer> partitions) throws IOException {
   m_numSources++;
   ExportDataSource source = new ExportDataSource(m_onSourceDrained, adFile);
   partitions.add(source.getPartitionId());
   m_timestamp = source.getGeneration();
   exportLog.info(
       "Creating ExportDataSource for "
           + adFile
           + " table "
           + source.getTableName()
           + " signature "
           + source.getSignature()
           + " partition id "
           + source.getPartitionId()
           + " bytes "
           + source.sizeInBytes());
   HashMap<String, ExportDataSource> dataSourcesForPartition =
       m_dataSourcesByPartition.get(source.getPartitionId());
   if (dataSourcesForPartition == null) {
     dataSourcesForPartition = new HashMap<String, ExportDataSource>();
     m_dataSourcesByPartition.put(source.getPartitionId(), dataSourcesForPartition);
   }
   dataSourcesForPartition.put(source.getSignature(), source);
 }