@Test public void dropTableEvent() throws Exception { ListenerEvent processedEvent = metaStoreEventDeserializer.unmarshal(dropTableEvent); DropTableEvent dropTableEvent = (DropTableEvent) processedEvent; assertThat(dropTableEvent.getDbName()).isEqualTo(TEST_DB); assertThat(dropTableEvent.getTableName()).isEqualTo(TEST_TABLE); assertThat(dropTableEvent.getTableLocation()).isEqualTo(TEST_TABLE_LOCATION); assertThat(dropTableEvent.getProtocolVersion()).isEqualTo("1.0"); assertThat(dropTableEvent.getEventType()).isEqualTo(EventType.DROP_TABLE); assertThat(dropTableEvent.getTableParameters()).isEqualTo(Maps.newHashMap()); }
@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);  }