@Test public void dropPartitionEvent() throws Exception { ListenerEvent processedEvent = metaStoreEventDeserializer.unmarshal(dropPartitionEvent); DropPartitionEvent dropPartitionEvent = (DropPartitionEvent) processedEvent; assertThat(dropPartitionEvent.getDbName()).isEqualTo(TEST_DB); assertThat(dropPartitionEvent.getTableName()).isEqualTo(TEST_TABLE); assertThat(dropPartitionEvent.getTableLocation()).isEqualTo(TEST_TABLE_LOCATION); assertThat(dropPartitionEvent.getProtocolVersion()).isEqualTo("1.0"); assertThat(dropPartitionEvent.getEventType()).isEqualTo(EventType.DROP_PARTITION); assertThat(dropPartitionEvent.getPartitionKeys()).isEqualTo(PARTITION_KEYS_MAP); assertThat(dropPartitionEvent.getPartitionValues()).isEqualTo(PARTITION_VALUES); assertThat(dropPartitionEvent.getPartitionLocation()).isEqualTo(PARTITION_LOCATION); assertThat(dropPartitionEvent.getTableParameters()).isEqualTo(TABLE_PARAM_MAP); }
@Override public <T extends ListenerEvent> T unmarshal(String payload) throws SerDeException { try { log.debug("Marshalled event is: {}", payload); T genericEvent = mapper.readerFor(HelperSerializableListenerEvent.class).readValue(payload); log.debug("Unmarshal event of type: {}", genericEvent.getEventType()); T event = mapper.readerFor(genericEvent.getEventType().eventClass()).readValue(payload); log.debug("Unmarshalled event is: {}", event); return event; } catch (Exception e) { throw new SerDeException("Unable to unmarshal event from payload", e); } }
JsonMetaStoreEventDeserializer implements MetaStoreEventDeserializer { @Override public <T extends ListenerEvent> T unmarshal(String payload) throws SerDeException { try { log.debug("Marshalled event is: {}", payload); T genericEvent = mapper.readerFor(HelperSerializableListenerEvent.class).readValue(payload); log.debug("Unmarshal event of type: {}", genericEvent.getEventType()); T event = mapper.readerFor(genericEvent.getEventType().eventClass()).readValue(payload); log.debug("Unmarshalled event is: {}", event); return event; } catch (Exception e) { throw new SerDeException("Unable to unmarshal event from payload", e); } } }
JsonMetaStoreEventDeserializer implements MetaStoreEventDeserializer { @Override public <T extends ListenerEvent> T unmarshal(String payload) throws SerDeException { try { log.debug("Marshalled event is: {}", payload); T genericEvent = mapper.readerFor(HelperSerializableListenerEvent.class).readValue(payload); log.debug("Unmarshal event of type: {}", genericEvent.getEventType()); T event = mapper.readerFor(genericEvent.getEventType().eventClass()).readValue(payload); log.debug("Unmarshalled event is: {}", event); return event; } catch (Exception e) { throw new SerDeException("Unable to unmarshal event from payload", e); } } JsonMetaStoreEventDeserializer(ObjectMapper mapper); }
JsonMetaStoreEventDeserializer implements MetaStoreEventDeserializer { @Override public <T extends ListenerEvent> T unmarshal(String payload) throws SerDeException { try { log.debug("Marshalled event is: {}", payload); T genericEvent = mapper.readerFor(HelperSerializableListenerEvent.class).readValue(payload); log.debug("Unmarshal event of type: {}", genericEvent.getEventType()); T event = mapper.readerFor(genericEvent.getEventType().eventClass()).readValue(payload); log.debug("Unmarshalled event is: {}", event); return event; } catch (Exception e) { throw new SerDeException("Unable to unmarshal event from payload", e); } } JsonMetaStoreEventDeserializer(ObjectMapper mapper); @Override T unmarshal(String payload); }
JsonMetaStoreEventDeserializer implements MetaStoreEventDeserializer { @Override public <T extends ListenerEvent> T unmarshal(String payload) throws SerDeException { try { log.debug("Marshalled event is: {}", payload); T genericEvent = mapper.readerFor(HelperSerializableListenerEvent.class).readValue(payload); log.debug("Unmarshal event of type: {}", genericEvent.getEventType()); T event = mapper.readerFor(genericEvent.getEventType().eventClass()).readValue(payload); log.debug("Unmarshalled event is: {}", event); return event; } catch (Exception e) { throw new SerDeException("Unable to unmarshal event from payload", e); } } JsonMetaStoreEventDeserializer(ObjectMapper mapper); @Override T unmarshal(String payload);  }