@Test public void getColumn() throws Exception { SwiftMetaData meta = mock(SwiftMetaData.class); when(meta.getColumnId("c")).thenReturn("cId"); RealtimeSegmentImpl seg = spy(new RealtimeSegmentImpl(new ResourceLocation("/"), meta)); assertNotEquals(seg.getColumn(new ColumnKey("c")), seg.getColumn(new ColumnKey("c"))); when(meta.getColumnId("d")).thenThrow(Exception.class); assertNull(seg.getColumn(new ColumnKey("d"))); }
@Override public <T> Column<T> getColumn(ColumnKey key) { try { String name = key.getName(); String columnId = meta.getColumnId(name); IResourceLocation child = location.buildChildLocation(columnId); Column<?> column = newColumn(child, ColumnTypeUtils.getClassType(meta.getColumn(name))); return (Column<T>) column; } catch (SwiftMetaDataColumnAbsentException e) { SwiftLoggers.getLogger().error("getColumn failed", e); return null; } catch (Exception e) { SwiftLoggers.getLogger().error("getColumn failed", e); return null; } }
RealtimeSegmentImpl extends BaseSegment implements RealtimeSegment { @Override public <T> Column<T> getColumn(ColumnKey key) { try { String name = key.getName(); String columnId = meta.getColumnId(name); IResourceLocation child = location.buildChildLocation(columnId); Column<?> column = newColumn(child, ColumnTypeUtils.getClassType(meta.getColumn(name))); return (Column<T>) column; } catch (SwiftMetaDataColumnAbsentException e) { SwiftLoggers.getLogger().error("getColumn failed", e); return null; } catch (Exception e) { SwiftLoggers.getLogger().error("getColumn failed", e); return null; } } }
RealtimeSegmentImpl extends BaseSegment implements RealtimeSegment { @Override public <T> Column<T> getColumn(ColumnKey key) { try { String name = key.getName(); String columnId = meta.getColumnId(name); IResourceLocation child = location.buildChildLocation(columnId); Column<?> column = newColumn(child, ColumnTypeUtils.getClassType(meta.getColumn(name))); return (Column<T>) column; } catch (SwiftMetaDataColumnAbsentException e) { SwiftLoggers.getLogger().error("getColumn failed", e); return null; } catch (Exception e) { SwiftLoggers.getLogger().error("getColumn failed", e); return null; } } RealtimeSegmentImpl(IResourceLocation parent, SwiftMetaData meta); }
RealtimeSegmentImpl extends BaseSegment implements RealtimeSegment { @Override public <T> Column<T> getColumn(ColumnKey key) { try { String name = key.getName(); String columnId = meta.getColumnId(name); IResourceLocation child = location.buildChildLocation(columnId); Column<?> column = newColumn(child, ColumnTypeUtils.getClassType(meta.getColumn(name))); return (Column<T>) column; } catch (SwiftMetaDataColumnAbsentException e) { SwiftLoggers.getLogger().error("getColumn failed", e); return null; } catch (Exception e) { SwiftLoggers.getLogger().error("getColumn failed", e); return null; } } RealtimeSegmentImpl(IResourceLocation parent, SwiftMetaData meta); @Override Column<T> getColumn(ColumnKey key); }
RealtimeSegmentImpl extends BaseSegment implements RealtimeSegment { @Override public <T> Column<T> getColumn(ColumnKey key) { try { String name = key.getName(); String columnId = meta.getColumnId(name); IResourceLocation child = location.buildChildLocation(columnId); Column<?> column = newColumn(child, ColumnTypeUtils.getClassType(meta.getColumn(name))); return (Column<T>) column; } catch (SwiftMetaDataColumnAbsentException e) { SwiftLoggers.getLogger().error("getColumn failed", e); return null; } catch (Exception e) { SwiftLoggers.getLogger().error("getColumn failed", e); return null; } } RealtimeSegmentImpl(IResourceLocation parent, SwiftMetaData meta); @Override Column<T> getColumn(ColumnKey key);  }