public HoodieRollingStatMetadata merge(HoodieRollingStatMetadata rollingStatMetadata) { for (Map.Entry<String, Map<String, HoodieRollingStat>> stat : rollingStatMetadata.partitionToRollingStats .entrySet()) { for (Map.Entry<String, HoodieRollingStat> innerStat : stat.getValue().entrySet()) { this.addRollingStat(stat.getKey(), innerStat.getValue()); } } return this; }
HoodieRollingStatMetadata rollingStatMetadata = new HoodieRollingStatMetadata(actionType); stat.getNumWrites() - (stat.getNumUpdateWrites() - stat.getNumDeletes()), stat.getNumUpdateWrites(), stat.getNumDeletes(), stat.getTotalWriteBytes()); rollingStatMetadata.addRollingStat(partitionPath, hoodieRollingStat); if (lastRollingStat.isPresent()) { rollingStatMetadata = rollingStatMetadata .merge(HoodieCommitMetadata.fromBytes(lastRollingStat.get().getBytes(), HoodieRollingStatMetadata.class)); metadata.addMetadata(HoodieRollingStatMetadata.ROLLING_STAT_METADATA_KEY, rollingStatMetadata.toJsonString()); } catch (IOException io) { throw new HoodieCommitException("Unable to save rolling stats");
int inserts = 0; for (Map.Entry<String, Map<String, HoodieRollingStat>> pstat : rollingStatMetadata.getPartitionToRollingStats().entrySet()) { for (Map.Entry<String, HoodieRollingStat> stat : pstat.getValue().entrySet()) { inserts += stat.getValue().getInserts(); inserts = 0; int upserts = 0; for (Map.Entry<String, Map<String, HoodieRollingStat>> pstat : rollingStatMetadata.getPartitionToRollingStats() .entrySet()) { for (Map.Entry<String, HoodieRollingStat> stat : pstat.getValue().entrySet()) { for (Map.Entry<String, Map<String, HoodieRollingStat>> entry : rollingStatMetadata.getPartitionToRollingStats() .entrySet()) { Assert.assertTrue(rollingStatMetadata1.getPartitionToRollingStats().containsKey(entry.getKey())); Assert.assertEquals(rollingStatMetadata1.getPartitionToRollingStats().get(entry.getKey()).size(), entry .getValue().size()); inserts = 0; upserts = 0; for (Map.Entry<String, Map<String, HoodieRollingStat>> pstat : rollingStatMetadata.getPartitionToRollingStats() .entrySet()) { for (Map.Entry<String, HoodieRollingStat> stat : pstat.getValue().entrySet()) {
HoodieRollingStatMetadata rollingStatMetadata = new HoodieRollingStatMetadata(actionType); stat.getNumWrites() - (stat.getNumUpdateWrites() - stat.getNumDeletes()), stat.getNumUpdateWrites(), stat.getNumDeletes(), stat.getTotalWriteBytes()); rollingStatMetadata.addRollingStat(status.getPartitionPath(), hoodieRollingStat); if (lastRollingStat.isPresent()) { rollingStatMetadata = rollingStatMetadata .merge(HoodieCommitMetadata.fromBytes(lastRollingStat.get().getBytes(), HoodieRollingStatMetadata.class)); metadata.addMetadata(HoodieRollingStatMetadata.ROLLING_STAT_METADATA_KEY, rollingStatMetadata.toJsonString()); } catch (IOException io) { throw new HoodieCommitException("Unable to save rolling stats");
.get(HoodieRollingStatMetadata.ROLLING_STAT_METADATA_KEY), HoodieRollingStatMetadata.class); int inserts = 0; for (Map.Entry<String, Map<String, HoodieRollingStat>> pstat : rollingStatMetadata.getPartitionToRollingStats() .entrySet()) { for (Map.Entry<String, HoodieRollingStat> stat : pstat.getValue().entrySet()) { inserts = 0; int upserts = 0; for (Map.Entry<String, Map<String, HoodieRollingStat>> pstat : rollingStatMetadata.getPartitionToRollingStats() .entrySet()) { for (Map.Entry<String, HoodieRollingStat> stat : pstat.getValue().entrySet()) {
int inserts = 0; for (Map.Entry<String, Map<String, HoodieRollingStat>> pstat : rollingStatMetadata.getPartitionToRollingStats().entrySet()) { for (Map.Entry<String, HoodieRollingStat> stat : pstat.getValue().entrySet()) { inserts += stat.getValue().getInserts(); inserts = 0; int upserts = 0; for (Map.Entry<String, Map<String, HoodieRollingStat>> pstat : rollingStatMetadata.getPartitionToRollingStats() .entrySet()) { for (Map.Entry<String, HoodieRollingStat> stat : pstat.getValue().entrySet()) { inserts = 0; upserts = 0; for (Map.Entry<String, Map<String, HoodieRollingStat>> pstat : rollingStatMetadata.getPartitionToRollingStats() .entrySet()) { for (Map.Entry<String, HoodieRollingStat> stat : pstat.getValue().entrySet()) {