@Test public void onDropPartition() throws MetaException { DropPartitionEvent event = mock(DropPartitionEvent.class); when(event.getStatus()).thenReturn(true); when(event.getTable()).thenReturn(table); List<Partition> partitions = new ArrayList<>(); partitions .add(new Partition(PARTITION_VALUES, DB_NAME, TABLE_NAME, 0, 0, createStorageDescriptor(partitionKeys, PARTITION_LOCATION), ImmutableMap.of())); when(event.getPartitionIterator()).thenReturn(partitions.iterator()); snsListener.onDropPartition(event); verify(snsClient).publish(requestCaptor.capture()); PublishRequest publishRequest = requestCaptor.getValue(); assertThat(publishRequest.getMessage(), is("{\"protocolVersion\":\"" + PROTOCOL_VERSION + "\",\"eventType\":\"" + EventType.DROP_PARTITION.toString() + "\",\"dbName\":\"some_db\",\"tableName\":\"some_table\",\"tableLocation\":\"s3: verifyMessageAttributes(publishRequest, EventType.DROP_PARTITION.toString(), "some_db", "some_table"); }
@Override public void onDropPartition(DropPartitionEvent event) throws MetaException { if (event.getStatus() == false) { return; } Iterator<Partition> partitions = event.getPartitionIterator(); while (partitions.hasNext()) { publishEvent(EventType.DROP_PARTITION, event.getTable(), null, partitions.next(), null); } }
ApiarySnsListener extends MetaStoreEventListener { @Override public void onDropPartition(DropPartitionEvent event) throws MetaException { if (event.getStatus() == false) { return; } Iterator<Partition> partitions = event.getPartitionIterator(); while (partitions.hasNext()) { publishEvent(EventType.DROP_PARTITION, event.getTable(), null, partitions.next(), null); } } }
ApiarySnsListener extends MetaStoreEventListener { @Override public void onDropPartition(DropPartitionEvent event) throws MetaException { if (event.getStatus() == false) { return; } Iterator<Partition> partitions = event.getPartitionIterator(); while (partitions.hasNext()) { publishEvent(EventType.DROP_PARTITION, event.getTable(), null, partitions.next(), null); } } ApiarySnsListener(Configuration config);   ApiarySnsListener(Configuration config, AmazonSNS snsClient); }
ApiarySnsListener extends MetaStoreEventListener { @Override public void onDropPartition(DropPartitionEvent event) throws MetaException { if (event.getStatus() == false) { return; } Iterator<Partition> partitions = event.getPartitionIterator(); while (partitions.hasNext()) { publishEvent(EventType.DROP_PARTITION, event.getTable(), null, partitions.next(), null); } } ApiarySnsListener(Configuration config);   ApiarySnsListener(Configuration config, AmazonSNS snsClient); @Override void onCreateTable(CreateTableEvent event); @Override void onDropTable(DropTableEvent event); @Override void onAlterTable(AlterTableEvent event); @Override void onAddPartition(AddPartitionEvent event); @Override void onDropPartition(DropPartitionEvent event); @Override void onInsert(InsertEvent event); @Override void onAlterPartition(AlterPartitionEvent event); }
ApiarySnsListener extends MetaStoreEventListener { @Override public void onDropPartition(DropPartitionEvent event) throws MetaException { if (event.getStatus() == false) { return; } Iterator<Partition> partitions = event.getPartitionIterator(); while (partitions.hasNext()) { publishEvent(EventType.DROP_PARTITION, event.getTable(), null, partitions.next(), null); } } ApiarySnsListener(Configuration config);   ApiarySnsListener(Configuration config, AmazonSNS snsClient); @Override void onCreateTable(CreateTableEvent event); @Override void onDropTable(DropTableEvent event); @Override void onAlterTable(AlterTableEvent event); @Override void onAddPartition(AddPartitionEvent event); @Override void onDropPartition(DropPartitionEvent event); @Override void onInsert(InsertEvent event); @Override void onAlterPartition(AlterPartitionEvent event);  }