// CHANGE : Up Sites
Host catalog_host = context.getHost();
Collection<Site> catalog_sites = CatalogUtil.getSitesForHost(catalog_host);
Site catalog_site = context.getSite();
Partition catalog_partition = context.getPartitionExecutor().getPartition();
LOG.trace("Table :" + tableName);
for (Site site : catalog_sites) {
for (Partition partition : site.getPartitions()) {
sites_to_partitions.put(site.getId(), partition.getId());
}
}
try {
initializeTableSaveFiles(m_filePath, m_fileNonce, tableName, originalHostIds, relevantPartitionIds, context);
} catch (IOException e) {
VoltTable result = constructResultsTable();
// e.printStackTrace();
result.addRow(m_hostId, hostname, m_siteId, tableName, relevantPartitionIds[0], "FAILURE", "Unable to load table: " + tableName + " error: " + e.getMessage());
return result;
}
int partition_id = context.getPartitionExecutor().getPartitionId();
LOG.trace("Starting performLoadPartitionedTable " + tableName + " at partition - " + partition_id);
String result_str = "SUCCESS";
String error_msg = "";
TableSaveFile savefile = null;
/**
* For partitioned tables
*/
try {
savefile = getTableSaveFile(getSaveFileForPartitionedTable(m_filePath, m_fileNonce, tableName,
catalog_host.getId(),
catalog_site.getId(),
catalog_partition.getId()),
3, null);
assert (savefile.getCompleted());
} catch (IOException e) {
VoltTable result = constructResultsTable();
result.addRow(m_hostId, hostname, m_siteId, tableName, -1, "FAILURE", "Unable to load table: " + tableName + " error: " + e.getMessage());