target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void ruleSuggestionsSingleElement() throws Exception { List<ExtractListRule> rules = recommender.getRules(new Selection("foo", "[ \"foo\", \"bar\", \"baz\" ]", 3, 3), DataType.LIST); assertEquals(1, rules.size()); assertEquals(ExtractListRuleType.single, rules.get(0).getType()); assertEquals(0, rules.get(0... | @Override public List<ExtractListRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.LIST, "Extract list items is supported only on LIST type columns"); JsonSelection jsonSelection; try { jsonSelection = new JSONElementLocator(selection.getCellText()).locate(selection.getOffs... | ExtractListRecommender extends Recommender<ExtractListRule, Selection> { @Override public List<ExtractListRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.LIST, "Extract list items is supported only on LIST type columns"); JsonSelection jsonSelection; try { jsonSelection =... | ExtractListRecommender extends Recommender<ExtractListRule, Selection> { @Override public List<ExtractListRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.LIST, "Extract list items is supported only on LIST type columns"); JsonSelection jsonSelection; try { jsonSelection =... | ExtractListRecommender extends Recommender<ExtractListRule, Selection> { @Override public List<ExtractListRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.LIST, "Extract list items is supported only on LIST type columns"); JsonSelection jsonSelection; try { jsonSelection =... | ExtractListRecommender extends Recommender<ExtractListRule, Selection> { @Override public List<ExtractListRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.LIST, "Extract list items is supported only on LIST type columns"); JsonSelection jsonSelection; try { jsonSelection =... |
@Test public void getAsTextFieldValue() { assertTrue("Sunday".equalsIgnoreCase(instance.getAsText(1, Locale.getDefault()))); assertTrue("Monday".equalsIgnoreCase(instance.getAsText(2, Locale.getDefault()))); assertTrue("Saturday".equalsIgnoreCase(instance.getAsText(7, Locale.getDefault()))); } | @Override public String getAsText(int fieldValue, Locale locale) { return chronology.dayOfWeek().getAsText(reverse(fieldValue), locale); } | DayOfWeekFromSundayDateTimeField extends PreciseDurationDateTimeField { @Override public String getAsText(int fieldValue, Locale locale) { return chronology.dayOfWeek().getAsText(reverse(fieldValue), locale); } } | DayOfWeekFromSundayDateTimeField extends PreciseDurationDateTimeField { @Override public String getAsText(int fieldValue, Locale locale) { return chronology.dayOfWeek().getAsText(reverse(fieldValue), locale); } DayOfWeekFromSundayDateTimeField(Chronology chronology, DurationField days); } | DayOfWeekFromSundayDateTimeField extends PreciseDurationDateTimeField { @Override public String getAsText(int fieldValue, Locale locale) { return chronology.dayOfWeek().getAsText(reverse(fieldValue), locale); } DayOfWeekFromSundayDateTimeField(Chronology chronology, DurationField days); @Override int get(long instant);... | DayOfWeekFromSundayDateTimeField extends PreciseDurationDateTimeField { @Override public String getAsText(int fieldValue, Locale locale) { return chronology.dayOfWeek().getAsText(reverse(fieldValue), locale); } DayOfWeekFromSundayDateTimeField(Chronology chronology, DurationField days); @Override int get(long instant);... |
@Test public void getAsShortTextFieldValue() { assertTrue("Sun".equalsIgnoreCase(instance.getAsShortText(1, Locale.getDefault()))); assertTrue("Mon".equalsIgnoreCase(instance.getAsShortText(2, Locale.getDefault()))); assertTrue("Sat".equalsIgnoreCase(instance.getAsShortText(7, Locale.getDefault()))); } | @Override public String getAsShortText(int fieldValue, Locale locale) { return chronology.dayOfWeek().getAsShortText(reverse(fieldValue), locale); } | DayOfWeekFromSundayDateTimeField extends PreciseDurationDateTimeField { @Override public String getAsShortText(int fieldValue, Locale locale) { return chronology.dayOfWeek().getAsShortText(reverse(fieldValue), locale); } } | DayOfWeekFromSundayDateTimeField extends PreciseDurationDateTimeField { @Override public String getAsShortText(int fieldValue, Locale locale) { return chronology.dayOfWeek().getAsShortText(reverse(fieldValue), locale); } DayOfWeekFromSundayDateTimeField(Chronology chronology, DurationField days); } | DayOfWeekFromSundayDateTimeField extends PreciseDurationDateTimeField { @Override public String getAsShortText(int fieldValue, Locale locale) { return chronology.dayOfWeek().getAsShortText(reverse(fieldValue), locale); } DayOfWeekFromSundayDateTimeField(Chronology chronology, DurationField days); @Override int get(long... | DayOfWeekFromSundayDateTimeField extends PreciseDurationDateTimeField { @Override public String getAsShortText(int fieldValue, Locale locale) { return chronology.dayOfWeek().getAsShortText(reverse(fieldValue), locale); } DayOfWeekFromSundayDateTimeField(Chronology chronology, DurationField days); @Override int get(long... |
@Test public void testFromOctalModeWithIllegalMode() { assertFails(() -> MorePosixFilePermissions.fromOctalMode(-1)); assertFails(() -> MorePosixFilePermissions.fromOctalMode(512)); assertFails(() -> MorePosixFilePermissions.fromOctalMode(Integer.MIN_VALUE)); assertFails(() -> MorePosixFilePermissions.fromOctalMode(Int... | public static Set<PosixFilePermission> fromOctalMode(int mode) { Preconditions.checkArgument(0 <= mode && mode <= MAX_MODE, "mode should be between 0 and 0777"); final Set<PosixFilePermission> result = EnumSet.noneOf(PosixFilePermission.class); int mask = 1 << (PERMISSIONS_LENGTH - 1); for (PosixFilePermission permissi... | MorePosixFilePermissions { public static Set<PosixFilePermission> fromOctalMode(int mode) { Preconditions.checkArgument(0 <= mode && mode <= MAX_MODE, "mode should be between 0 and 0777"); final Set<PosixFilePermission> result = EnumSet.noneOf(PosixFilePermission.class); int mask = 1 << (PERMISSIONS_LENGTH - 1); for (P... | MorePosixFilePermissions { public static Set<PosixFilePermission> fromOctalMode(int mode) { Preconditions.checkArgument(0 <= mode && mode <= MAX_MODE, "mode should be between 0 and 0777"); final Set<PosixFilePermission> result = EnumSet.noneOf(PosixFilePermission.class); int mask = 1 << (PERMISSIONS_LENGTH - 1); for (P... | MorePosixFilePermissions { public static Set<PosixFilePermission> fromOctalMode(int mode) { Preconditions.checkArgument(0 <= mode && mode <= MAX_MODE, "mode should be between 0 and 0777"); final Set<PosixFilePermission> result = EnumSet.noneOf(PosixFilePermission.class); int mask = 1 << (PERMISSIONS_LENGTH - 1); for (P... | MorePosixFilePermissions { public static Set<PosixFilePermission> fromOctalMode(int mode) { Preconditions.checkArgument(0 <= mode && mode <= MAX_MODE, "mode should be between 0 and 0777"); final Set<PosixFilePermission> result = EnumSet.noneOf(PosixFilePermission.class); int mask = 1 << (PERMISSIONS_LENGTH - 1); for (P... |
@Test public void testParent() { checkParent(Path.of("/foo/bar"), Path.of("/foo")); checkParent(Path.of("/foo"), Path.of("/")); checkParent(Path.of("/"), null); checkParent(Path.of("foo/bar"), Path.of("foo")); checkParent(Path.of("foo"), Path.of(".")); } | public static Path of(URI uri) { return new Path(uri); } | Path implements Comparable<Path> { public static Path of(URI uri) { return new Path(uri); } } | Path implements Comparable<Path> { public static Path of(URI uri) { return new Path(uri); } private Path(URI uri); } | Path implements Comparable<Path> { public static Path of(URI uri) { return new Path(uri); } private Path(URI uri); static Path of(URI uri); static Path of(String path); static Path mergePaths(Path path1, Path path2); static Path withoutSchemeAndAuthority(Path path); String getName(); Path getParent(); Path resolve(Pat... | Path implements Comparable<Path> { public static Path of(URI uri) { return new Path(uri); } private Path(URI uri); static Path of(URI uri); static Path of(String path); static Path mergePaths(Path path1, Path path2); static Path withoutSchemeAndAuthority(Path path); String getName(); Path getParent(); Path resolve(Pat... |
@Test public void testResolveOfPath() { checkResolveOfPath(Path.of("hdfs: checkResolveOfPath(Path.of("hdfs: checkResolveOfPath(Path.of("hdfs: checkResolveOfPath(Path.of("hdfs: checkResolveOfPath(Path.of("."), Path.of("foo"), Path.of("foo")); checkResolveOfPath(Path.of("foo"), Path.of("."), Path.of("foo")); checkResolve... | public static Path of(URI uri) { return new Path(uri); } | Path implements Comparable<Path> { public static Path of(URI uri) { return new Path(uri); } } | Path implements Comparable<Path> { public static Path of(URI uri) { return new Path(uri); } private Path(URI uri); } | Path implements Comparable<Path> { public static Path of(URI uri) { return new Path(uri); } private Path(URI uri); static Path of(URI uri); static Path of(String path); static Path mergePaths(Path path1, Path path2); static Path withoutSchemeAndAuthority(Path path); String getName(); Path getParent(); Path resolve(Pat... | Path implements Comparable<Path> { public static Path of(URI uri) { return new Path(uri); } private Path(URI uri); static Path of(URI uri); static Path of(String path); static Path mergePaths(Path path1, Path path2); static Path withoutSchemeAndAuthority(Path path); String getName(); Path getParent(); Path resolve(Pat... |
@Test public void testResolveOfString() { checkResolveOfString(Path.of("hdfs: checkResolveOfString(Path.of("hdfs: checkResolveOfString(Path.of("hdfs: checkResolveOfString(Path.of("hdfs: checkResolveOfString(Path.of("."), "foo", Path.of("foo")); checkResolveOfString(Path.of("foo"), ".", Path.of("foo")); checkResolveOfSt... | public static Path of(URI uri) { return new Path(uri); } | Path implements Comparable<Path> { public static Path of(URI uri) { return new Path(uri); } } | Path implements Comparable<Path> { public static Path of(URI uri) { return new Path(uri); } private Path(URI uri); } | Path implements Comparable<Path> { public static Path of(URI uri) { return new Path(uri); } private Path(URI uri); static Path of(URI uri); static Path of(String path); static Path mergePaths(Path path1, Path path2); static Path withoutSchemeAndAuthority(Path path); String getName(); Path getParent(); Path resolve(Pat... | Path implements Comparable<Path> { public static Path of(URI uri) { return new Path(uri); } private Path(URI uri); static Path of(URI uri); static Path of(String path); static Path mergePaths(Path path1, Path path2); static Path withoutSchemeAndAuthority(Path path); String getName(); Path getParent(); Path resolve(Pat... |
@Test public void testMergePaths() { checkMergePaths(Path.of("hdfs: checkMergePaths(Path.of("hdfs: checkMergePaths(Path.of("hdfs: checkMergePaths(Path.of("hdfs: checkMergePaths(Path.of("."), Path.of("foo"), Path.of("foo")); checkMergePaths(Path.of("foo"), Path.of("."), Path.of("foo")); checkMergePaths(Path.of("/"), Pat... | public static Path mergePaths(Path path1, Path path2) { final String path1Path = path1.uri.getPath(); final String path2Path = path2.uri.getPath(); if (path2Path.isEmpty()) { return path1; } final StringBuilder finalPath = new StringBuilder(path1Path.length() + path2Path.length() + 1); finalPath.append(path1Path); if (... | Path implements Comparable<Path> { public static Path mergePaths(Path path1, Path path2) { final String path1Path = path1.uri.getPath(); final String path2Path = path2.uri.getPath(); if (path2Path.isEmpty()) { return path1; } final StringBuilder finalPath = new StringBuilder(path1Path.length() + path2Path.length() + 1)... | Path implements Comparable<Path> { public static Path mergePaths(Path path1, Path path2) { final String path1Path = path1.uri.getPath(); final String path2Path = path2.uri.getPath(); if (path2Path.isEmpty()) { return path1; } final StringBuilder finalPath = new StringBuilder(path1Path.length() + path2Path.length() + 1)... | Path implements Comparable<Path> { public static Path mergePaths(Path path1, Path path2) { final String path1Path = path1.uri.getPath(); final String path2Path = path2.uri.getPath(); if (path2Path.isEmpty()) { return path1; } final StringBuilder finalPath = new StringBuilder(path1Path.length() + path2Path.length() + 1)... | Path implements Comparable<Path> { public static Path mergePaths(Path path1, Path path2) { final String path1Path = path1.uri.getPath(); final String path2Path = path2.uri.getPath(); if (path2Path.isEmpty()) { return path1; } final StringBuilder finalPath = new StringBuilder(path1Path.length() + path2Path.length() + 1)... |
@Test public void testGetName() { checkGetName(Path.of("/foo/bar"), "bar"); checkGetName(Path.of("/foo/bar baz"), "bar baz"); checkGetName(Path.of(" checkGetName(Path.of("foo/bar"), "bar"); checkGetName(Path.of("hdfs: checkGetName(Path.of("hdfs: checkGetName(Path.of("file:/foo/bar baz"), "bar baz"); checkGetName(Path.o... | public String getName() { final String path = uri.getPath(); int index = path.lastIndexOf(SEPARATOR_CHAR); return path.substring(index + 1); } | Path implements Comparable<Path> { public String getName() { final String path = uri.getPath(); int index = path.lastIndexOf(SEPARATOR_CHAR); return path.substring(index + 1); } } | Path implements Comparable<Path> { public String getName() { final String path = uri.getPath(); int index = path.lastIndexOf(SEPARATOR_CHAR); return path.substring(index + 1); } private Path(URI uri); } | Path implements Comparable<Path> { public String getName() { final String path = uri.getPath(); int index = path.lastIndexOf(SEPARATOR_CHAR); return path.substring(index + 1); } private Path(URI uri); static Path of(URI uri); static Path of(String path); static Path mergePaths(Path path1, Path path2); static Path with... | Path implements Comparable<Path> { public String getName() { final String path = uri.getPath(); int index = path.lastIndexOf(SEPARATOR_CHAR); return path.substring(index + 1); } private Path(URI uri); static Path of(URI uri); static Path of(String path); static Path mergePaths(Path path1, Path path2); static Path with... |
@Test public void testIsAbsolute() { checkIsAbsolute(Path.of("/"), true); checkIsAbsolute(Path.of("/foo"), true); checkIsAbsolute(Path.of("/foo/bar"), true); checkIsAbsolute(Path.of("foo"), false); checkIsAbsolute(Path.of("foo/bar"), false); checkIsAbsolute(Path.of(URI.create("")), false); checkIsAbsolute(Path.of("."),... | public boolean isAbsolute() { return uri.getPath().startsWith(SEPARATOR); } | Path implements Comparable<Path> { public boolean isAbsolute() { return uri.getPath().startsWith(SEPARATOR); } } | Path implements Comparable<Path> { public boolean isAbsolute() { return uri.getPath().startsWith(SEPARATOR); } private Path(URI uri); } | Path implements Comparable<Path> { public boolean isAbsolute() { return uri.getPath().startsWith(SEPARATOR); } private Path(URI uri); static Path of(URI uri); static Path of(String path); static Path mergePaths(Path path1, Path path2); static Path withoutSchemeAndAuthority(Path path); String getName(); Path getParent(... | Path implements Comparable<Path> { public boolean isAbsolute() { return uri.getPath().startsWith(SEPARATOR); } private Path(URI uri); static Path of(URI uri); static Path of(String path); static Path mergePaths(Path path1, Path path2); static Path withoutSchemeAndAuthority(Path path); String getName(); Path getParent(... |
@Test public void testDepth() { checkDepth(Path.of("/"), 0); checkDepth(Path.of("/foo"), 1); checkDepth(Path.of("/foo/bar"), 2); checkDepth(Path.of("foo"), 0); } | public int depth() { final String path = uri.getPath(); if (path.charAt(0) == SEPARATOR_CHAR && path.length() == 1) { return 0; } int depth = 0; for (int i = 0 ; i < path.length(); i++) { if (path.charAt(i) == SEPARATOR_CHAR) { depth++; } } return depth; } | Path implements Comparable<Path> { public int depth() { final String path = uri.getPath(); if (path.charAt(0) == SEPARATOR_CHAR && path.length() == 1) { return 0; } int depth = 0; for (int i = 0 ; i < path.length(); i++) { if (path.charAt(i) == SEPARATOR_CHAR) { depth++; } } return depth; } } | Path implements Comparable<Path> { public int depth() { final String path = uri.getPath(); if (path.charAt(0) == SEPARATOR_CHAR && path.length() == 1) { return 0; } int depth = 0; for (int i = 0 ; i < path.length(); i++) { if (path.charAt(i) == SEPARATOR_CHAR) { depth++; } } return depth; } private Path(URI uri); } | Path implements Comparable<Path> { public int depth() { final String path = uri.getPath(); if (path.charAt(0) == SEPARATOR_CHAR && path.length() == 1) { return 0; } int depth = 0; for (int i = 0 ; i < path.length(); i++) { if (path.charAt(i) == SEPARATOR_CHAR) { depth++; } } return depth; } private Path(URI uri); stat... | Path implements Comparable<Path> { public int depth() { final String path = uri.getPath(); if (path.charAt(0) == SEPARATOR_CHAR && path.length() == 1) { return 0; } int depth = 0; for (int i = 0 ; i < path.length(); i++) { if (path.charAt(i) == SEPARATOR_CHAR) { depth++; } } return depth; } private Path(URI uri); stat... |
@Test public void ruleSuggestionsMultiElement() throws Exception { List<ExtractListRule> rules = recommender.getRules(new Selection("foo", "[ \"foo\", \"bar\", \"baz\" ]", 3, 10), DataType.LIST); assertEquals(4, rules.size()); compare(new Offset(0, FROM_THE_START), new Offset(1, FROM_THE_START), rules.get(0)); compare(... | @Override public List<ExtractListRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.LIST, "Extract list items is supported only on LIST type columns"); JsonSelection jsonSelection; try { jsonSelection = new JSONElementLocator(selection.getCellText()).locate(selection.getOffs... | ExtractListRecommender extends Recommender<ExtractListRule, Selection> { @Override public List<ExtractListRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.LIST, "Extract list items is supported only on LIST type columns"); JsonSelection jsonSelection; try { jsonSelection =... | ExtractListRecommender extends Recommender<ExtractListRule, Selection> { @Override public List<ExtractListRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.LIST, "Extract list items is supported only on LIST type columns"); JsonSelection jsonSelection; try { jsonSelection =... | ExtractListRecommender extends Recommender<ExtractListRule, Selection> { @Override public List<ExtractListRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.LIST, "Extract list items is supported only on LIST type columns"); JsonSelection jsonSelection; try { jsonSelection =... | ExtractListRecommender extends Recommender<ExtractListRule, Selection> { @Override public List<ExtractListRule> getRules(Selection selection, DataType selColType) { checkArgument(selColType == DataType.LIST, "Extract list items is supported only on LIST type columns"); JsonSelection jsonSelection; try { jsonSelection =... |
@Test public void testReplace() throws Exception { doTestReplace(false); } | public <T extends Service> T replace(@Nullable T service) { if (service == null) { return null; } final Service toReplace = wrapService(service); for(ListIterator<Service> it = services.listIterator(); it.hasNext(); ) { Service s = it.next(); if (toReplace.equals(s)) { it.remove(); try { s.close(); } catch (Exception e... | ServiceRegistry implements Service { public <T extends Service> T replace(@Nullable T service) { if (service == null) { return null; } final Service toReplace = wrapService(service); for(ListIterator<Service> it = services.listIterator(); it.hasNext(); ) { Service s = it.next(); if (toReplace.equals(s)) { it.remove(); ... | ServiceRegistry implements Service { public <T extends Service> T replace(@Nullable T service) { if (service == null) { return null; } final Service toReplace = wrapService(service); for(ListIterator<Service> it = services.listIterator(); it.hasNext(); ) { Service s = it.next(); if (toReplace.equals(s)) { it.remove(); ... | ServiceRegistry implements Service { public <T extends Service> T replace(@Nullable T service) { if (service == null) { return null; } final Service toReplace = wrapService(service); for(ListIterator<Service> it = services.listIterator(); it.hasNext(); ) { Service s = it.next(); if (toReplace.equals(s)) { it.remove(); ... | ServiceRegistry implements Service { public <T extends Service> T replace(@Nullable T service) { if (service == null) { return null; } final Service toReplace = wrapService(service); for(ListIterator<Service> it = services.listIterator(); it.hasNext(); ) { Service s = it.next(); if (toReplace.equals(s)) { it.remove(); ... |
@Test public void initialize() { DremioConfig config = DremioConfig.create(); } | public static DremioConfig create() { return create(null); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... |
@Test public void fileOverride() { properties.clear(DremioConfig.EMBEDDED_MASTER_ZK_ENABLED_BOOL); properties.clear(DremioConfig.LOCAL_WRITE_PATH_STRING); properties.clear(DremioConfig.DB_PATH_STRING); properties.clear("dremd.write"); DremioConfig config = DremioConfig.create(getClass().getResource("/test-dremio.conf")... | public static DremioConfig create() { return create(null); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... |
@Test public void distOverride() { properties.clear(DremioConfig.EMBEDDED_MASTER_ZK_ENABLED_BOOL); properties.clear(DremioConfig.LOCAL_WRITE_PATH_STRING); properties.clear(DremioConfig.DB_PATH_STRING); properties.clear("dremd.write"); DremioConfig config = DremioConfig.create(getClass().getResource("/test-dremio4.conf"... | public static DremioConfig create() { return create(null); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... |
@Test public void systemOverFile(){ final String path = "my.fave.path"; properties.set(DremioConfig.DB_PATH_STRING, path); DremioConfig config = DremioConfig.create(getClass().getResource("/test-dremio.conf")); assertEquals(path, config.getString(DremioConfig.DB_PATH_STRING)); } | public static DremioConfig create() { return create(null); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... |
@Test public void arrayProperties() throws Exception { DremioConfig config = DremioConfig.create(getClass().getResource("/test-dremio3.conf")); String property = (config.getStringList(DremioConfig.SPILLING_PATH_STRING)).toString(); final String path = property; properties.set(DremioConfig.SPILLING_PATH_STRING, path); D... | public static DremioConfig create() { return create(null); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... |
@Test public void badProperty() { exception.expect(RuntimeException.class); exception.expectMessage("mistyped-property"); @SuppressWarnings("unused") DremioConfig config = DremioConfig.create(getClass().getResource("/test-dremio2.conf")); } | public static DremioConfig create() { return create(null); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... |
@Test public void legacySystemProp() { String name = "dremio_autoPort"; properties.set(name, "true"); assertEquals(true, DremioConfig.create().getBoolean(DremioConfig.DEBUG_AUTOPORT_BOOL)); } | public static DremioConfig create() { return create(null); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... |
@Test public void newSystemProp() { String name = DremioConfig.DEBUG_AUTOPORT_BOOL; properties.set(name, "false"); assertEquals(false, DremioConfig.create().getBoolean(name)); properties.set(name, "true"); assertEquals(true, DremioConfig.create().getBoolean(name)); } | public static DremioConfig create() { return create(null); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... |
@Test public void newSystemPropWithDependency() { String name = DremioConfig.LOCAL_WRITE_PATH_STRING; properties.set(name, "my.special.path"); assertEquals("my.special.path/db", DremioConfig.create().getString(DremioConfig.DB_PATH_STRING)); } | public static DremioConfig create() { return create(null); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); } | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... | DremioConfig extends NestedConfig { public static DremioConfig create() { return create(null); } private DremioConfig(SabotConfig sabot, Config unresolved, Config reference, String thisNode); @Override DremioConfig withValue(String path, ConfigValue value); DremioConfig withSabotValue(String path, ConfigValue value); ... |
@Test public void testExtractListCardGen() throws Exception { { ExtractListRule rule = new ExtractRuleSingle(0).wrap(); TransformRuleWrapper<ExtractListRule> wrapper = recommender.wrapRule(rule); assertEquals("\"tbl name\".foo[0] IS NOT NULL", wrapper.getMatchFunctionExpr("\"tbl name\".foo")); assertEquals("\"tbl name\... | @Override public TransformRuleWrapper<ExtractListRule> wrapRule(ExtractListRule rule) { switch (rule.getType()) { case single: return new ExtractListSingleTransformRuleWrapper(rule); case multiple: return new ExtractListMultipleTransformRuleWrapper(rule); default: throw UserException.unsupportedError() .message("Unsupp... | ExtractListRecommender extends Recommender<ExtractListRule, Selection> { @Override public TransformRuleWrapper<ExtractListRule> wrapRule(ExtractListRule rule) { switch (rule.getType()) { case single: return new ExtractListSingleTransformRuleWrapper(rule); case multiple: return new ExtractListMultipleTransformRuleWrappe... | ExtractListRecommender extends Recommender<ExtractListRule, Selection> { @Override public TransformRuleWrapper<ExtractListRule> wrapRule(ExtractListRule rule) { switch (rule.getType()) { case single: return new ExtractListSingleTransformRuleWrapper(rule); case multiple: return new ExtractListMultipleTransformRuleWrappe... | ExtractListRecommender extends Recommender<ExtractListRule, Selection> { @Override public TransformRuleWrapper<ExtractListRule> wrapRule(ExtractListRule rule) { switch (rule.getType()) { case single: return new ExtractListSingleTransformRuleWrapper(rule); case multiple: return new ExtractListMultipleTransformRuleWrappe... | ExtractListRecommender extends Recommender<ExtractListRule, Selection> { @Override public TransformRuleWrapper<ExtractListRule> wrapRule(ExtractListRule rule) { switch (rule.getType()) { case single: return new ExtractListSingleTransformRuleWrapper(rule); case multiple: return new ExtractListMultipleTransformRuleWrappe... |
@Test public void testWithFullNode() { try ( BufferAllocator root = allocatorRule.newAllocator("test-memory-debug-info", 0, 1024 * 1024); BufferAllocator child = root.newChildAllocator("child", 0, 16 * 1024); BufferAllocator grandChild1 = child.newChildAllocator("grandchild1", 0, 64 * 1024); BufferAllocator grandChild2... | public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPresent()) { sb.append... | MemoryDebugInfo { public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPres... | MemoryDebugInfo { public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPres... | MemoryDebugInfo { public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPres... | MemoryDebugInfo { public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPres... |
@Test public void testWithRoot() { try ( BufferAllocator root = allocatorRule.newAllocator("test-memory-debug-info", 0, 1024 * 1024); BufferAllocator child = root.newChildAllocator("child", 0, Integer.MAX_VALUE); BufferAllocator grandChild1 = child.newChildAllocator("grandchild1", 0, Integer.MAX_VALUE); BufferAllocator... | public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPresent()) { sb.append... | MemoryDebugInfo { public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPres... | MemoryDebugInfo { public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPres... | MemoryDebugInfo { public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPres... | MemoryDebugInfo { public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPres... |
@Test public void testPrune() throws Exception { try (RollbackCloseable closeable = new RollbackCloseable(true)) { BufferAllocator root = allocatorRule.newAllocator("test-memory-debug-info", 0, 1024 * 1024); closeable.add(root); BufferAllocator twig = root.newChildAllocator("twig",0, 1024 * 1024); closeable.add(twig); ... | public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPresent()) { sb.append... | MemoryDebugInfo { public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPres... | MemoryDebugInfo { public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPres... | MemoryDebugInfo { public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPres... | MemoryDebugInfo { public static String getDetailsOnAllocationFailure(OutOfMemoryException exception, BufferAllocator allocator) { BufferAllocator failedAtAllocator = null; StringBuilder sb = new StringBuilder(); Optional<AllocationOutcomeDetails> outcomeDetails = exception.getOutcomeDetails(); if (outcomeDetails.isPres... |
@Test public void testBasic() { SettableFuture<Integer> future = SettableFuture.create(); Integer expectedValue = 1234; future.set(expectedValue); try { Integer result = DremioFutures.getChecked(future, TestException.class, TestDremioFutures::testMapper); assertEquals(result, expectedValue); } catch (TestException igno... | public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper); throw new Ass... | DremioFutures { public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper... | DremioFutures { public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper... | DremioFutures { public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper... | DremioFutures { public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper... |
@Test public void testTimeout() { SettableFuture future = SettableFuture.create(); Futures.addCallback(future, new FutureCallback<Integer>() { @Override public void onSuccess(@Nullable Integer result) { try { Thread.sleep(10000); } catch (InterruptedException ignored) { } future.set(result); } @Override public void onF... | public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper); throw new Ass... | DremioFutures { public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper... | DremioFutures { public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper... | DremioFutures { public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper... | DremioFutures { public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper... |
@Test public void testMappingCause() { Future future = mock(Future.class); Throwable cause = new TestException("inner exception"); try { when(future.get()).thenThrow(new ExecutionException("outer exception", cause)); } catch (InterruptedException | ExecutionException ignored) { throw new AssertionError(); } try { Dremi... | public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper); throw new Ass... | DremioFutures { public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper... | DremioFutures { public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper... | DremioFutures { public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper... | DremioFutures { public static <T, X extends Exception> T getChecked( Future<T> future, Class<X> exceptionClass, Function<? super Throwable, ? extends X> mapper ) throws X { try { return Futures.getChecked(future, ExecutionException.class); } catch (ExecutionException e) { try { handleException(e, exceptionClass, mapper... |
@Test public void testCompatibleNodeEndpoints() { NodeEndpoint nep1 = NodeEndpoint.newBuilder() .setAddress("localhost") .setDremioVersion(DremioVersionInfo.getVersion()) .build(); NodeEndpoint nep2 = NodeEndpoint.newBuilder() .setAddress("localhost") .setDremioVersion("incompatibleVersion") .build(); Collection<NodeEn... | public static Collection<NodeEndpoint> getCompatibleNodeEndpoints(Collection<NodeEndpoint> nodeEndpoints) { List<NodeEndpoint> compatibleNodeEndpoints = new ArrayList<>(); if (nodeEndpoints != null && !nodeEndpoints.isEmpty()) { compatibleNodeEndpoints = nodeEndpoints.stream() .filter(nep -> isCompatibleVersion(nep)) .... | DremioVersionUtils { public static Collection<NodeEndpoint> getCompatibleNodeEndpoints(Collection<NodeEndpoint> nodeEndpoints) { List<NodeEndpoint> compatibleNodeEndpoints = new ArrayList<>(); if (nodeEndpoints != null && !nodeEndpoints.isEmpty()) { compatibleNodeEndpoints = nodeEndpoints.stream() .filter(nep -> isComp... | DremioVersionUtils { public static Collection<NodeEndpoint> getCompatibleNodeEndpoints(Collection<NodeEndpoint> nodeEndpoints) { List<NodeEndpoint> compatibleNodeEndpoints = new ArrayList<>(); if (nodeEndpoints != null && !nodeEndpoints.isEmpty()) { compatibleNodeEndpoints = nodeEndpoints.stream() .filter(nep -> isComp... | DremioVersionUtils { public static Collection<NodeEndpoint> getCompatibleNodeEndpoints(Collection<NodeEndpoint> nodeEndpoints) { List<NodeEndpoint> compatibleNodeEndpoints = new ArrayList<>(); if (nodeEndpoints != null && !nodeEndpoints.isEmpty()) { compatibleNodeEndpoints = nodeEndpoints.stream() .filter(nep -> isComp... | DremioVersionUtils { public static Collection<NodeEndpoint> getCompatibleNodeEndpoints(Collection<NodeEndpoint> nodeEndpoints) { List<NodeEndpoint> compatibleNodeEndpoints = new ArrayList<>(); if (nodeEndpoints != null && !nodeEndpoints.isEmpty()) { compatibleNodeEndpoints = nodeEndpoints.stream() .filter(nep -> isComp... |
@Test public void testBackwardCompatofSchema() throws Exception { Schema schema = DremioArrowSchema.fromJSON(OLD_SCHEMA); String newJson = schema.toJson(); assertFalse(newJson.contains("typeLayout")); } | public static Schema fromJSON(String json) throws IOException { return mapper.readValue(checkNotNull(json), Schema.class); } | BackwardCompatibleSchemaDe extends StdDeserializer<Schema> { public static Schema fromJSON(String json) throws IOException { return mapper.readValue(checkNotNull(json), Schema.class); } } | BackwardCompatibleSchemaDe extends StdDeserializer<Schema> { public static Schema fromJSON(String json) throws IOException { return mapper.readValue(checkNotNull(json), Schema.class); } protected BackwardCompatibleSchemaDe(); protected BackwardCompatibleSchemaDe(Class<?> vc); } | BackwardCompatibleSchemaDe extends StdDeserializer<Schema> { public static Schema fromJSON(String json) throws IOException { return mapper.readValue(checkNotNull(json), Schema.class); } protected BackwardCompatibleSchemaDe(); protected BackwardCompatibleSchemaDe(Class<?> vc); static Schema fromJSON(String json); @Ove... | BackwardCompatibleSchemaDe extends StdDeserializer<Schema> { public static Schema fromJSON(String json) throws IOException { return mapper.readValue(checkNotNull(json), Schema.class); } protected BackwardCompatibleSchemaDe(); protected BackwardCompatibleSchemaDe(Class<?> vc); static Schema fromJSON(String json); @Ove... |
@Test public void testSerializeDeserialize() throws Exception { UserException ex = UserException.functionError() .message("test") .setAdditionalExceptionContext(new TestContext(TEST_DATA)) .build(logger); Assert.assertTrue(ex.getRawAdditionalExceptionContext() != null); Assert.assertTrue(TEST_DATA.equals(TestContext.fr... | protected static <T extends AdditionalExceptionContext> T fromUserException(Class<T> clazz, UserException ex) { if (ex.getRawAdditionalExceptionContext() == null) { logger.debug("missing additional context in UserException"); return null; } try { return ProtobufByteStringSerDe.readValue(contextMapper.readerFor(clazz), ... | JsonAdditionalExceptionContext implements AdditionalExceptionContext { protected static <T extends AdditionalExceptionContext> T fromUserException(Class<T> clazz, UserException ex) { if (ex.getRawAdditionalExceptionContext() == null) { logger.debug("missing additional context in UserException"); return null; } try { re... | JsonAdditionalExceptionContext implements AdditionalExceptionContext { protected static <T extends AdditionalExceptionContext> T fromUserException(Class<T> clazz, UserException ex) { if (ex.getRawAdditionalExceptionContext() == null) { logger.debug("missing additional context in UserException"); return null; } try { re... | JsonAdditionalExceptionContext implements AdditionalExceptionContext { protected static <T extends AdditionalExceptionContext> T fromUserException(Class<T> clazz, UserException ex) { if (ex.getRawAdditionalExceptionContext() == null) { logger.debug("missing additional context in UserException"); return null; } try { re... | JsonAdditionalExceptionContext implements AdditionalExceptionContext { protected static <T extends AdditionalExceptionContext> T fromUserException(Class<T> clazz, UserException ex) { if (ex.getRawAdditionalExceptionContext() == null) { logger.debug("missing additional context in UserException"); return null; } try { re... |
@Test public void testClose() { Resource r1 = new Resource(); Resource r2 = new Resource(); Resource r3 = new Resource(); Resource r4 = new Resource(); try { AutoCloseables.close( () -> r1.closeWithException(new IOException("R1 exception")), () -> r2.closeWithException(null), () -> r3.closeWithException(new RuntimeExce... | public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } } | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } private AutoCloseables(); } | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } private AutoCloseables(); static AutoCloseable all(final Collection<? extends AutoCloseable> autoCloseables); static void close(Throwable t, AutoCloseable... autoCloseables); static void... | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } private AutoCloseables(); static AutoCloseable all(final Collection<? extends AutoCloseable> autoCloseables); static void close(Throwable t, AutoCloseable... autoCloseables); static void... |
@Test public void testMatcher() { ReplaceMatcher matcher = ReplaceRecommender.getMatcher( new ReplacePatternRule(ReplaceSelectionType.MATCHES) .setSelectionPattern("[ac]") .setIgnoreCase(false)); Match match = matcher.matches("abc"); assertNotNull(match); assertEquals("Match(0, 1)", match.toString()); } | public static ReplaceMatcher getMatcher(ReplacePatternRule rule) { final String pattern = rule.getSelectionPattern(); ReplaceSelectionType selectionType = rule.getSelectionType(); if (rule.getIgnoreCase() != null && rule.getIgnoreCase()) { return new ToLowerReplaceMatcher(getMatcher(pattern.toLowerCase(), selectionType... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public static ReplaceMatcher getMatcher(ReplacePatternRule rule) { final String pattern = rule.getSelectionPattern(); ReplaceSelectionType selectionType = rule.getSelectionType(); if (rule.getIgnoreCase() != null && rule.getIgnoreCase()) { return n... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public static ReplaceMatcher getMatcher(ReplacePatternRule rule) { final String pattern = rule.getSelectionPattern(); ReplaceSelectionType selectionType = rule.getSelectionType(); if (rule.getIgnoreCase() != null && rule.getIgnoreCase()) { return n... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public static ReplaceMatcher getMatcher(ReplacePatternRule rule) { final String pattern = rule.getSelectionPattern(); ReplaceSelectionType selectionType = rule.getSelectionType(); if (rule.getIgnoreCase() != null && rule.getIgnoreCase()) { return n... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { public static ReplaceMatcher getMatcher(ReplacePatternRule rule) { final String pattern = rule.getSelectionPattern(); ReplaceSelectionType selectionType = rule.getSelectionType(); if (rule.getIgnoreCase() != null && rule.getIgnoreCase()) { return n... |
@Test(expected = IOException.class) public void testCloseWithExpectedException() throws IOException { Resource r1 = new Resource(); Resource r2 = new Resource(); AutoCloseables.close(IOException.class, () -> r1.closeWithException(new IOException("R1 exception")), () -> r2.closeWithException(new RuntimeException("R3 exc... | public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } } | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } private AutoCloseables(); } | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } private AutoCloseables(); static AutoCloseable all(final Collection<? extends AutoCloseable> autoCloseables); static void close(Throwable t, AutoCloseable... autoCloseables); static void... | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } private AutoCloseables(); static AutoCloseable all(final Collection<? extends AutoCloseable> autoCloseables); static void close(Throwable t, AutoCloseable... autoCloseables); static void... |
@Test(expected = RuntimeException.class) public void testCloseWithExpectedRuntimeException() throws IOException { Resource r1 = new Resource(); Resource r2 = new Resource(); AutoCloseables.close(IOException.class, () -> r1.closeWithException(new RuntimeException("R1 exception")), () -> r2.closeWithException(new IOExcep... | public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } } | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } private AutoCloseables(); } | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } private AutoCloseables(); static AutoCloseable all(final Collection<? extends AutoCloseable> autoCloseables); static void close(Throwable t, AutoCloseable... autoCloseables); static void... | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } private AutoCloseables(); static AutoCloseable all(final Collection<? extends AutoCloseable> autoCloseables); static void close(Throwable t, AutoCloseable... autoCloseables); static void... |
@Test(expected = IOException.class) public void testCloseWithExpectedWrappedException() throws IOException { Resource r1 = new Resource(); Resource r2 = new Resource(); AutoCloseables.close(IOException.class, () -> r1.closeWithException(new Exception("R1 exception")), () -> r2.closeWithException(new Exception("R3 excep... | public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } } | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } private AutoCloseables(); } | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } private AutoCloseables(); static AutoCloseable all(final Collection<? extends AutoCloseable> autoCloseables); static void close(Throwable t, AutoCloseable... autoCloseables); static void... | AutoCloseables { public static void close(Throwable t, AutoCloseable... autoCloseables) { close(t, Arrays.asList(autoCloseables)); } private AutoCloseables(); static AutoCloseable all(final Collection<? extends AutoCloseable> autoCloseables); static void close(Throwable t, AutoCloseable... autoCloseables); static void... |
@Test public void testTraceWrapperFunction() { MockSpan parent = tracer.buildSpan("parent").start(); final MockSpan[] child = new MockSpan[1]; final int ret; try(Scope s = tracer.activateSpan(parent)) { ret = TracingUtils.trace( (span) -> { span.log("someRunTimeEvent"); child[0] = ((MockSpan) span); return 42; }, trace... | public static <R> R trace(Function<Span, R> work, Tracer tracer, String operation, String... tags) { Span span = TracingUtils.buildChildSpan(tracer, operation, tags); try (Scope s = tracer.activateSpan(span)) { return work.apply(span); } finally { span.finish(); } } | TracingUtils { public static <R> R trace(Function<Span, R> work, Tracer tracer, String operation, String... tags) { Span span = TracingUtils.buildChildSpan(tracer, operation, tags); try (Scope s = tracer.activateSpan(span)) { return work.apply(span); } finally { span.finish(); } } } | TracingUtils { public static <R> R trace(Function<Span, R> work, Tracer tracer, String operation, String... tags) { Span span = TracingUtils.buildChildSpan(tracer, operation, tags); try (Scope s = tracer.activateSpan(span)) { return work.apply(span); } finally { span.finish(); } } private TracingUtils(); } | TracingUtils { public static <R> R trace(Function<Span, R> work, Tracer tracer, String operation, String... tags) { Span span = TracingUtils.buildChildSpan(tracer, operation, tags); try (Scope s = tracer.activateSpan(span)) { return work.apply(span); } finally { span.finish(); } } private TracingUtils(); static Tracer... | TracingUtils { public static <R> R trace(Function<Span, R> work, Tracer tracer, String operation, String... tags) { Span span = TracingUtils.buildChildSpan(tracer, operation, tags); try (Scope s = tracer.activateSpan(span)) { return work.apply(span); } finally { span.finish(); } } private TracingUtils(); static Tracer... |
@Test public void testRunnableDecoration() throws InterruptedException, ExecutionException { Span[] runnableSpan = new Span[1]; try (Scope s = tracer.activateSpan(testSpan)) { Future<?> future = pool.submit(() -> { runnableSpan[0] = tracer.activeSpan(); }); future.get(); } assertChildSpan(runnableSpan[0]); } | @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } | ContextMigratingExecutorService implements ExecutorService { @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } } | ContextMigratingExecutorService implements ExecutorService { @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } ContextMigratingExecutorService(E delegate, Tracer tracer); } | ContextMigratingExecutorService implements ExecutorService { @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } ContextMigratingExecutorService(E delegate, Tracer tracer); @Override void shutdown(); @Override List<Runnable> shutdownNow(); @Override boolean isShutdown(); ... | ContextMigratingExecutorService implements ExecutorService { @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } ContextMigratingExecutorService(E delegate, Tracer tracer); @Override void shutdown(); @Override List<Runnable> shutdownNow(); @Override boolean isShutdown(); ... |
@Test public void testContextWithCallable() throws Exception { final String testUser = "testUser1"; Callable<String> callable = () -> RequestContext.current().get(UserContext.CTX_KEY).serialize(); Future<String> future = RequestContext.empty() .with(UserContext.CTX_KEY, new UserContext(testUser)) .call(() -> pool.submi... | @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } | ContextMigratingExecutorService implements ExecutorService { @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } } | ContextMigratingExecutorService implements ExecutorService { @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } ContextMigratingExecutorService(E delegate, Tracer tracer); } | ContextMigratingExecutorService implements ExecutorService { @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } ContextMigratingExecutorService(E delegate, Tracer tracer); @Override void shutdown(); @Override List<Runnable> shutdownNow(); @Override boolean isShutdown(); ... | ContextMigratingExecutorService implements ExecutorService { @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } ContextMigratingExecutorService(E delegate, Tracer tracer); @Override void shutdown(); @Override List<Runnable> shutdownNow(); @Override boolean isShutdown(); ... |
@Test public void testContextWithRunnable() throws Exception { final String testUser = "testUser2"; final Pointer<String> foundUser = new Pointer<>(); Runnable runnable = () -> foundUser.value = RequestContext.current().get(UserContext.CTX_KEY).serialize(); Future<?> future = RequestContext.empty() .with(UserContext.CT... | @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } | ContextMigratingExecutorService implements ExecutorService { @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } } | ContextMigratingExecutorService implements ExecutorService { @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } ContextMigratingExecutorService(E delegate, Tracer tracer); } | ContextMigratingExecutorService implements ExecutorService { @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } ContextMigratingExecutorService(E delegate, Tracer tracer); @Override void shutdown(); @Override List<Runnable> shutdownNow(); @Override boolean isShutdown(); ... | ContextMigratingExecutorService implements ExecutorService { @Override public <T> Future<T> submit(Callable<T> task) { return delegate.submit(decorate(task)); } ContextMigratingExecutorService(E delegate, Tracer tracer); @Override void shutdown(); @Override List<Runnable> shutdownNow(); @Override boolean isShutdown(); ... |
@Test public void testMultiBind() throws Exception { final GuiceServiceModule guiceServiceHandler = new GuiceServiceModule(); final Injector injector = Guice.createInjector(guiceServiceHandler, new MultiBindModule()); final MultiImpl bInstance = (MultiImpl) injector.getInstance(B.class); final MultiImpl cInstance = (Mu... | public void close(Injector injector) throws Exception { serviceList.forEach((clazz) -> { final Object instance = injector.getInstance(clazz); if (instance instanceof Service) { try { logger.debug("stopping {}", instance.getClass().toString()); ((Service) instance).close(); } catch (Exception e) { throwIfUnchecked(e); t... | GuiceServiceModule extends AbstractModule { public void close(Injector injector) throws Exception { serviceList.forEach((clazz) -> { final Object instance = injector.getInstance(clazz); if (instance instanceof Service) { try { logger.debug("stopping {}", instance.getClass().toString()); ((Service) instance).close(); } ... | GuiceServiceModule extends AbstractModule { public void close(Injector injector) throws Exception { serviceList.forEach((clazz) -> { final Object instance = injector.getInstance(clazz); if (instance instanceof Service) { try { logger.debug("stopping {}", instance.getClass().toString()); ((Service) instance).close(); } ... | GuiceServiceModule extends AbstractModule { public void close(Injector injector) throws Exception { serviceList.forEach((clazz) -> { final Object instance = injector.getInstance(clazz); if (instance instanceof Service) { try { logger.debug("stopping {}", instance.getClass().toString()); ((Service) instance).close(); } ... | GuiceServiceModule extends AbstractModule { public void close(Injector injector) throws Exception { serviceList.forEach((clazz) -> { final Object instance = injector.getInstance(clazz); if (instance instanceof Service) { try { logger.debug("stopping {}", instance.getClass().toString()); ((Service) instance).close(); } ... |
@Test public void writeInt32() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeInt32(1, 9, false); subject.writeInt32(2, 8, false); Mockito.verify(delegate).writeInt32(1,9, false); Mockito.ve... | @Override public void writeInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeInt32(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeInt32(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeInt32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNameTo... | BlackListOutput implements Output { @Override public void writeInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeInt32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNameTo... | BlackListOutput implements Output { @Override public void writeInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeInt32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNameTo... |
@Test public void writeUInt32() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeUInt32(1, 9, false); subject.writeUInt32(2, 8, false); Mockito.verify(delegate).writeUInt32(1,9, false); Mockit... | @Override public void writeUInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeUInt32(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeUInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeUInt32(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeUInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeUInt32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaName... | BlackListOutput implements Output { @Override public void writeUInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeUInt32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaName... | BlackListOutput implements Output { @Override public void writeUInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeUInt32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaName... |
@Test public void ruleSuggestionsSelectMiddleText() { Selection selection = new Selection("col", "This is a text", 5, 2); List<ReplacePatternRule> rules = recommender.getRules(selection, TEXT); assertEquals(2, rules.size()); compare(ReplaceSelectionType.CONTAINS, "is", true, rules.get(0)); compare(ReplaceSelectionType.... | @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns"); List<ReplacePatternRule> rules = new ArrayList<>(); if (selection.ge... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... |
@Test public void writeSInt32() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeSInt32(1, 9, false); subject.writeSInt32(2, 8, false); Mockito.verify(delegate).writeSInt32(1,9, false); Mockit... | @Override public void writeSInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSInt32(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeSInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSInt32(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeSInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSInt32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaName... | BlackListOutput implements Output { @Override public void writeSInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSInt32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaName... | BlackListOutput implements Output { @Override public void writeSInt32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSInt32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaName... |
@Test public void writeFixed32() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeFixed32(1, 9, false); subject.writeFixed32(2, 8, false); Mockito.verify(delegate).writeFixed32(1,9, false); Mo... | @Override public void writeFixed32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFixed32(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeFixed32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFixed32(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeFixed32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFixed32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNa... | BlackListOutput implements Output { @Override public void writeFixed32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFixed32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNa... | BlackListOutput implements Output { @Override public void writeFixed32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFixed32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNa... |
@Test public void writeSFixed32() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeSFixed32(1, 9, false); subject.writeSFixed32(2, 8, false); Mockito.verify(delegate).writeSFixed32(1,9, false)... | @Override public void writeSFixed32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSFixed32(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeSFixed32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSFixed32(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeSFixed32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSFixed32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schema... | BlackListOutput implements Output { @Override public void writeSFixed32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSFixed32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schema... | BlackListOutput implements Output { @Override public void writeSFixed32(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSFixed32(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schema... |
@Test public void writeInt64() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeInt64(1, 9, false); subject.writeInt64(2, 8, false); Mockito.verify(delegate).writeInt64(1,9, false); Mockito.ve... | @Override public void writeInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeInt64(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeInt64(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeInt64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNameT... | BlackListOutput implements Output { @Override public void writeInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeInt64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNameT... | BlackListOutput implements Output { @Override public void writeInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeInt64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNameT... |
@Test public void writeUInt64() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeUInt64(1, 9, false); subject.writeUInt64(2, 8, false); Mockito.verify(delegate).writeUInt64(1,9, false); Mockit... | @Override public void writeUInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeUInt64(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeUInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeUInt64(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeUInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeUInt64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNam... | BlackListOutput implements Output { @Override public void writeUInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeUInt64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNam... | BlackListOutput implements Output { @Override public void writeUInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeUInt64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNam... |
@Test public void writeSInt64() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeSInt64(1, 9, false); subject.writeSInt64(2, 8, false); Mockito.verify(delegate).writeSInt64(1,9, false); Mockit... | @Override public void writeSInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSInt64(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeSInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSInt64(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeSInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSInt64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNam... | BlackListOutput implements Output { @Override public void writeSInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSInt64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNam... | BlackListOutput implements Output { @Override public void writeSInt64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSInt64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNam... |
@Test public void writeFixed64() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeFixed64(1, 9, false); subject.writeFixed64(2, 8, false); Mockito.verify(delegate).writeFixed64(1,9, false); Mo... | @Override public void writeFixed64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFixed64(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeFixed64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFixed64(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeFixed64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFixed64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaN... | BlackListOutput implements Output { @Override public void writeFixed64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFixed64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaN... | BlackListOutput implements Output { @Override public void writeFixed64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFixed64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaN... |
@Test public void writeSFixed64() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeSFixed64(1, 9, false); subject.writeSFixed64(2, 8, false); Mockito.verify(delegate).writeSFixed64(1,9, false)... | @Override public void writeSFixed64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSFixed64(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeSFixed64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSFixed64(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeSFixed64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSFixed64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schem... | BlackListOutput implements Output { @Override public void writeSFixed64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSFixed64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schem... | BlackListOutput implements Output { @Override public void writeSFixed64(int fieldNumber, long value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeSFixed64(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schem... |
@Test public void writeFloat() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeFloat(1, 9, false); subject.writeFloat(2, 8, false); Mockito.verify(delegate).writeFloat(1,9, false); Mockito.ve... | @Override public void writeFloat(int fieldNumber, float value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFloat(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeFloat(int fieldNumber, float value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFloat(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeFloat(int fieldNumber, float value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFloat(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaName... | BlackListOutput implements Output { @Override public void writeFloat(int fieldNumber, float value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFloat(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaName... | BlackListOutput implements Output { @Override public void writeFloat(int fieldNumber, float value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeFloat(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaName... |
@Test public void writeDouble() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeDouble(1, 9, false); subject.writeDouble(2, 8, false); Mockito.verify(delegate).writeDouble(1,9, false); Mockit... | @Override public void writeDouble(int fieldNumber, double value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeDouble(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeDouble(int fieldNumber, double value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeDouble(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeDouble(int fieldNumber, double value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeDouble(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaN... | BlackListOutput implements Output { @Override public void writeDouble(int fieldNumber, double value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeDouble(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaN... | BlackListOutput implements Output { @Override public void writeDouble(int fieldNumber, double value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeDouble(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaN... |
@Test public void ruleSuggestionsSelectMiddleNumber() { Selection selection = new Selection("col", "There are 20 types of people", 10, 2); List<ReplacePatternRule> rules = recommender.getRules(selection, TEXT); assertEquals(2, rules.size()); compare(ReplaceSelectionType.CONTAINS, "20", false, rules.get(0)); compare(Rep... | @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns"); List<ReplacePatternRule> rules = new ArrayList<>(); if (selection.ge... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... |
@Test public void testDependenciesResolver() throws Exception { DACConfig dacConfig = DACConfig.newConfig(); Upgrade upgrade = new Upgrade(dacConfig, CLASSPATH_SCAN_RESULT, false); List<? extends UpgradeTask> tasks = upgrade.getUpgradeTasks(); boolean isMapr = Boolean.valueOf(System.getProperty("dremio.mapr.profile"));... | @VisibleForTesting List<? extends UpgradeTask> getUpgradeTasks() { return upgradeTasks; } | Upgrade { @VisibleForTesting List<? extends UpgradeTask> getUpgradeTasks() { return upgradeTasks; } } | Upgrade { @VisibleForTesting List<? extends UpgradeTask> getUpgradeTasks() { return upgradeTasks; } Upgrade(DACConfig dacConfig, ScanResult classPathScan, boolean verbose); } | Upgrade { @VisibleForTesting List<? extends UpgradeTask> getUpgradeTasks() { return upgradeTasks; } Upgrade(DACConfig dacConfig, ScanResult classPathScan, boolean verbose); void run(); void run(boolean noDBOpenRetry); @VisibleForTesting void validateUpgrade(final LegacyKVStoreProvider storeProvider, final String curEdi... | Upgrade { @VisibleForTesting List<? extends UpgradeTask> getUpgradeTasks() { return upgradeTasks; } Upgrade(DACConfig dacConfig, ScanResult classPathScan, boolean verbose); void run(); void run(boolean noDBOpenRetry); @VisibleForTesting void validateUpgrade(final LegacyKVStoreProvider storeProvider, final String curEdi... |
@Test public void writeBool() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeBool(1, true, false); subject.writeBool(2, false, false); Mockito.verify(delegate).writeBool(1,true, false); Mock... | @Override public void writeBool(int fieldNumber, boolean value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBool(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeBool(int fieldNumber, boolean value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBool(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeBool(int fieldNumber, boolean value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBool(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaName... | BlackListOutput implements Output { @Override public void writeBool(int fieldNumber, boolean value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBool(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaName... | BlackListOutput implements Output { @Override public void writeBool(int fieldNumber, boolean value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBool(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaName... |
@Test public void writeEnum() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeEnum(1, 1, false); subject.writeEnum(2, 2, false); Mockito.verify(delegate).writeEnum(1,1, false); Mockito.verify... | @Override public void writeEnum(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeEnum(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeEnum(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeEnum(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeEnum(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeEnum(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNameToBl... | BlackListOutput implements Output { @Override public void writeEnum(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeEnum(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNameToBl... | BlackListOutput implements Output { @Override public void writeEnum(int fieldNumber, int value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeEnum(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaNameToBl... |
@Test public void writeString() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeString(1, "1", false); subject.writeString(2, "2", false); Mockito.verify(delegate).writeString(1,"1", false); ... | @Override public void writeString(int fieldNumber, String value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeString(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeString(int fieldNumber, String value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeString(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeString(int fieldNumber, String value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeString(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaN... | BlackListOutput implements Output { @Override public void writeString(int fieldNumber, String value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeString(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaN... | BlackListOutput implements Output { @Override public void writeString(int fieldNumber, String value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeString(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schemaN... |
@Test public void writeByteString() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeBytes(1, ByteString.bytesDefaultValue("1"), false); subject.writeBytes(2, ByteString.bytesDefaultValue("2")... | @Override public void writeBytes(int fieldNumber, ByteString value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBytes(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeBytes(int fieldNumber, ByteString value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBytes(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeBytes(int fieldNumber, ByteString value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBytes(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schem... | BlackListOutput implements Output { @Override public void writeBytes(int fieldNumber, ByteString value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBytes(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schem... | BlackListOutput implements Output { @Override public void writeBytes(int fieldNumber, ByteString value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBytes(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schem... |
@Test public void writeByteBuffer() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeBytes(1, ByteBuffer.wrap(new byte[]{1}), false); subject.writeBytes(2, ByteBuffer.wrap(new byte[]{2}), fals... | @Override public void writeBytes(int fieldNumber, ByteString value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBytes(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeBytes(int fieldNumber, ByteString value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBytes(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeBytes(int fieldNumber, ByteString value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBytes(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schem... | BlackListOutput implements Output { @Override public void writeBytes(int fieldNumber, ByteString value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBytes(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schem... | BlackListOutput implements Output { @Override public void writeBytes(int fieldNumber, ByteString value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeBytes(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> schem... |
@Test public void writeByteArray() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeByteArray(1, new byte[]{1}, false); subject.writeByteArray(2, new byte[]{2}, false); Mockito.verify(delegate... | @Override public void writeByteArray(int fieldNumber, byte[] value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeByteArray(fieldNumber, value, repeated); } | BlackListOutput implements Output { @Override public void writeByteArray(int fieldNumber, byte[] value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeByteArray(fieldNumber, value, repeated); } } | BlackListOutput implements Output { @Override public void writeByteArray(int fieldNumber, byte[] value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeByteArray(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> s... | BlackListOutput implements Output { @Override public void writeByteArray(int fieldNumber, byte[] value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeByteArray(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> s... | BlackListOutput implements Output { @Override public void writeByteArray(int fieldNumber, byte[] value, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeByteArray(fieldNumber, value, repeated); } @VisibleForTesting BlackListOutput(
Output delegate, Map<String, int[]> s... |
@Test public void writeByteRange() throws IOException { Output delegate = Mockito.mock(Output.class); BlackListOutput subject = new BlackListOutput( delegate, Collections.emptyMap(), new int[]{2} ); subject.writeByteRange(false,1, new byte[]{1}, 0, 1, false); subject.writeByteRange(false,2, new byte[]{2}, 0,1,false); M... | @Override public void writeByteRange(boolean utf8String, int fieldNumber, byte[] value, int offset, int length, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeByteRange(utf8String, fieldNumber, value, offset, length, repeated); } | BlackListOutput implements Output { @Override public void writeByteRange(boolean utf8String, int fieldNumber, byte[] value, int offset, int length, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeByteRange(utf8String, fieldNumber, value, offset, length, repeated); } } | BlackListOutput implements Output { @Override public void writeByteRange(boolean utf8String, int fieldNumber, byte[] value, int offset, int length, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeByteRange(utf8String, fieldNumber, value, offset, length, repeated); } @Visib... | BlackListOutput implements Output { @Override public void writeByteRange(boolean utf8String, int fieldNumber, byte[] value, int offset, int length, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeByteRange(utf8String, fieldNumber, value, offset, length, repeated); } @Visib... | BlackListOutput implements Output { @Override public void writeByteRange(boolean utf8String, int fieldNumber, byte[] value, int offset, int length, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } delegate.writeByteRange(utf8String, fieldNumber, value, offset, length, repeated); } @Visib... |
@Test public void writeObject() throws IOException { Output delegate = Mockito.mock(Output.class); Object object = new Object(); String schemaName = "Hello Schema"; String shortName = "Hello"; Schema<Object> schema = Mockito.mock(Schema.class); int[] subSet = new int[]{4}; BlackListOutput subject = new BlackListOutput(... | @Override public <T> void writeObject(int fieldNumber, T value, Schema<T> schema, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } int[] parentBlackList = currentBlackList; try { String messageFullName = schema.messageFullName(); currentBlackList = schemaNameToBlackList.getOrDefault(mess... | BlackListOutput implements Output { @Override public <T> void writeObject(int fieldNumber, T value, Schema<T> schema, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } int[] parentBlackList = currentBlackList; try { String messageFullName = schema.messageFullName(); currentBlackList = sch... | BlackListOutput implements Output { @Override public <T> void writeObject(int fieldNumber, T value, Schema<T> schema, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } int[] parentBlackList = currentBlackList; try { String messageFullName = schema.messageFullName(); currentBlackList = sch... | BlackListOutput implements Output { @Override public <T> void writeObject(int fieldNumber, T value, Schema<T> schema, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } int[] parentBlackList = currentBlackList; try { String messageFullName = schema.messageFullName(); currentBlackList = sch... | BlackListOutput implements Output { @Override public <T> void writeObject(int fieldNumber, T value, Schema<T> schema, boolean repeated) throws IOException { if(isBlackListed(fieldNumber)){ return; } int[] parentBlackList = currentBlackList; try { String messageFullName = schema.messageFullName(); currentBlackList = sch... |
@Test public void testNoInput() { HasherOutput subject = new HasherOutput(); String result = subject.getHasher().hash().toString(); Assert.assertEquals("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", result); } | public Hasher getHasher() { return hasher; } | HasherOutput implements Output { public Hasher getHasher() { return hasher; } } | HasherOutput implements Output { public Hasher getHasher() { return hasher; } HasherOutput(Hasher hasher); HasherOutput(); } | HasherOutput implements Output { public Hasher getHasher() { return hasher; } HasherOutput(Hasher hasher); HasherOutput(); @Override void writeInt32(int fieldNumber, int value, boolean repeated); @Override void writeUInt32(int fieldNumber, int value, boolean repeated); @Override void writeSInt32(int fieldNumber, int v... | HasherOutput implements Output { public Hasher getHasher() { return hasher; } HasherOutput(Hasher hasher); HasherOutput(); @Override void writeInt32(int fieldNumber, int value, boolean repeated); @Override void writeUInt32(int fieldNumber, int value, boolean repeated); @Override void writeSInt32(int fieldNumber, int v... |
@Test public void testGet16BytesFromUUID() { UUID uuid = UUID.randomUUID(); byte[] result = UUIDAdapter.getBytesFromUUID(uuid); assertEquals("Expected result to be a byte array with 16 elements.", 16, result.length); } | public static byte[] getBytesFromUUID(UUID uuid) { byte[] result = new byte[16]; long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); for (int i =15;i>=8;i--) { result[i] = (byte) (lsb & 0xFF); lsb >>= 8; } for (int i =7;i>=0;i--) { result[i] = (byte) (msb & 0xFF); msb >>= 8; } return re... | UUIDAdapter { public static byte[] getBytesFromUUID(UUID uuid) { byte[] result = new byte[16]; long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); for (int i =15;i>=8;i--) { result[i] = (byte) (lsb & 0xFF); lsb >>= 8; } for (int i =7;i>=0;i--) { result[i] = (byte) (msb & 0xFF); msb >>= ... | UUIDAdapter { public static byte[] getBytesFromUUID(UUID uuid) { byte[] result = new byte[16]; long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); for (int i =15;i>=8;i--) { result[i] = (byte) (lsb & 0xFF); lsb >>= 8; } for (int i =7;i>=0;i--) { result[i] = (byte) (msb & 0xFF); msb >>= ... | UUIDAdapter { public static byte[] getBytesFromUUID(UUID uuid) { byte[] result = new byte[16]; long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); for (int i =15;i>=8;i--) { result[i] = (byte) (lsb & 0xFF); lsb >>= 8; } for (int i =7;i>=0;i--) { result[i] = (byte) (msb & 0xFF); msb >>= ... | UUIDAdapter { public static byte[] getBytesFromUUID(UUID uuid) { byte[] result = new byte[16]; long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); for (int i =15;i>=8;i--) { result[i] = (byte) (lsb & 0xFF); lsb >>= 8; } for (int i =7;i>=0;i--) { result[i] = (byte) (msb & 0xFF); msb >>= ... |
@Test public void ruleSuggestionsSelectBeginningText() { Selection selection = new Selection("col", "There are 20 types of people", 0, 5); List<ReplacePatternRule> rules = recommender.getRules(selection, TEXT); assertEquals(4, rules.size()); compare(ReplaceSelectionType.CONTAINS, "There", true, rules.get(0)); compare(R... | @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns"); List<ReplacePatternRule> rules = new ArrayList<>(); if (selection.ge... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... |
@Test public void testShouldNotGenerateSameUUIDFromBytes() { UUID uuid = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d"); byte[] result = UUIDAdapter.getBytesFromUUID(uuid); UUID newUuid = UUID.nameUUIDFromBytes(result); assertFalse(uuid.equals(newUuid)); } | public static byte[] getBytesFromUUID(UUID uuid) { byte[] result = new byte[16]; long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); for (int i =15;i>=8;i--) { result[i] = (byte) (lsb & 0xFF); lsb >>= 8; } for (int i =7;i>=0;i--) { result[i] = (byte) (msb & 0xFF); msb >>= 8; } return re... | UUIDAdapter { public static byte[] getBytesFromUUID(UUID uuid) { byte[] result = new byte[16]; long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); for (int i =15;i>=8;i--) { result[i] = (byte) (lsb & 0xFF); lsb >>= 8; } for (int i =7;i>=0;i--) { result[i] = (byte) (msb & 0xFF); msb >>= ... | UUIDAdapter { public static byte[] getBytesFromUUID(UUID uuid) { byte[] result = new byte[16]; long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); for (int i =15;i>=8;i--) { result[i] = (byte) (lsb & 0xFF); lsb >>= 8; } for (int i =7;i>=0;i--) { result[i] = (byte) (msb & 0xFF); msb >>= ... | UUIDAdapter { public static byte[] getBytesFromUUID(UUID uuid) { byte[] result = new byte[16]; long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); for (int i =15;i>=8;i--) { result[i] = (byte) (lsb & 0xFF); lsb >>= 8; } for (int i =7;i>=0;i--) { result[i] = (byte) (msb & 0xFF); msb >>= ... | UUIDAdapter { public static byte[] getBytesFromUUID(UUID uuid) { byte[] result = new byte[16]; long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); for (int i =15;i>=8;i--) { result[i] = (byte) (lsb & 0xFF); lsb >>= 8; } for (int i =7;i>=0;i--) { result[i] = (byte) (msb & 0xFF); msb >>= ... |
@Test public void testIsKeyword() { assertTrue(SqlUtils.isKeyword("USER")); assertTrue(SqlUtils.isKeyword("FiLeS")); assertFalse(SqlUtils.isKeyword("myUSER")); } | public static boolean isKeyword(String id) { Preconditions.checkState(RESERVED_SQL_KEYWORDS != null, "SQL reserved keyword list is not loaded. Please check the logs for error messages."); return RESERVED_SQL_KEYWORDS.contains(id.toUpperCase()); } | SqlUtils { public static boolean isKeyword(String id) { Preconditions.checkState(RESERVED_SQL_KEYWORDS != null, "SQL reserved keyword list is not loaded. Please check the logs for error messages."); return RESERVED_SQL_KEYWORDS.contains(id.toUpperCase()); } } | SqlUtils { public static boolean isKeyword(String id) { Preconditions.checkState(RESERVED_SQL_KEYWORDS != null, "SQL reserved keyword list is not loaded. Please check the logs for error messages."); return RESERVED_SQL_KEYWORDS.contains(id.toUpperCase()); } } | SqlUtils { public static boolean isKeyword(String id) { Preconditions.checkState(RESERVED_SQL_KEYWORDS != null, "SQL reserved keyword list is not loaded. Please check the logs for error messages."); return RESERVED_SQL_KEYWORDS.contains(id.toUpperCase()); } static String quotedCompound(List<String> strings); static St... | SqlUtils { public static boolean isKeyword(String id) { Preconditions.checkState(RESERVED_SQL_KEYWORDS != null, "SQL reserved keyword list is not loaded. Please check the logs for error messages."); return RESERVED_SQL_KEYWORDS.contains(id.toUpperCase()); } static String quotedCompound(List<String> strings); static St... |
@Test public void testQuoteIdentifier() { assertEquals("\"window\"", SqlUtils.quoteIdentifier("window")); assertEquals("\"metadata\"", SqlUtils.quoteIdentifier("metadata")); assertEquals("abc", SqlUtils.quoteIdentifier("abc")); assertEquals("abc123", SqlUtils.quoteIdentifier("abc123")); assertEquals("a_bc", SqlUtils.qu... | public static String quoteIdentifier(final String id) { if (id.isEmpty()) { return id; } if (isKeyword(id)) { return quoteString(id); } if (Character.isAlphabetic(id.charAt(0)) && ALPHANUM_MATCHER.matchesAllOf(id)) { return id; } if (NEWLINE_MATCHER.matchesAnyOf(id)) { return quoteUnicodeString(id); } return quoteStrin... | SqlUtils { public static String quoteIdentifier(final String id) { if (id.isEmpty()) { return id; } if (isKeyword(id)) { return quoteString(id); } if (Character.isAlphabetic(id.charAt(0)) && ALPHANUM_MATCHER.matchesAllOf(id)) { return id; } if (NEWLINE_MATCHER.matchesAnyOf(id)) { return quoteUnicodeString(id); } return... | SqlUtils { public static String quoteIdentifier(final String id) { if (id.isEmpty()) { return id; } if (isKeyword(id)) { return quoteString(id); } if (Character.isAlphabetic(id.charAt(0)) && ALPHANUM_MATCHER.matchesAllOf(id)) { return id; } if (NEWLINE_MATCHER.matchesAnyOf(id)) { return quoteUnicodeString(id); } return... | SqlUtils { public static String quoteIdentifier(final String id) { if (id.isEmpty()) { return id; } if (isKeyword(id)) { return quoteString(id); } if (Character.isAlphabetic(id.charAt(0)) && ALPHANUM_MATCHER.matchesAllOf(id)) { return id; } if (NEWLINE_MATCHER.matchesAnyOf(id)) { return quoteUnicodeString(id); } return... | SqlUtils { public static String quoteIdentifier(final String id) { if (id.isEmpty()) { return id; } if (isKeyword(id)) { return quoteString(id); } if (Character.isAlphabetic(id.charAt(0)) && ALPHANUM_MATCHER.matchesAllOf(id)) { return id; } if (NEWLINE_MATCHER.matchesAnyOf(id)) { return quoteUnicodeString(id); } return... |
@Test public void testParseSchemaPath() { assertEquals(asList("a", "b", "c"), SqlUtils.parseSchemaPath("a.b.c")); assertEquals(asList("a"), SqlUtils.parseSchemaPath("a")); assertEquals(asList("a", "b.c", "d"), SqlUtils.parseSchemaPath("a.\"b.c\".d")); assertEquals(asList("a", "c"), SqlUtils.parseSchemaPath("a..c")); } | public static List<String> parseSchemaPath(String schemaPath) { return new StrTokenizer(schemaPath, '.', SqlUtils.QUOTE) .setIgnoreEmptyTokens(true) .getTokenList(); } | SqlUtils { public static List<String> parseSchemaPath(String schemaPath) { return new StrTokenizer(schemaPath, '.', SqlUtils.QUOTE) .setIgnoreEmptyTokens(true) .getTokenList(); } } | SqlUtils { public static List<String> parseSchemaPath(String schemaPath) { return new StrTokenizer(schemaPath, '.', SqlUtils.QUOTE) .setIgnoreEmptyTokens(true) .getTokenList(); } } | SqlUtils { public static List<String> parseSchemaPath(String schemaPath) { return new StrTokenizer(schemaPath, '.', SqlUtils.QUOTE) .setIgnoreEmptyTokens(true) .getTokenList(); } static String quotedCompound(List<String> strings); static String quoteIdentifier(final String id); static boolean isKeyword(String id); sta... | SqlUtils { public static List<String> parseSchemaPath(String schemaPath) { return new StrTokenizer(schemaPath, '.', SqlUtils.QUOTE) .setIgnoreEmptyTokens(true) .getTokenList(); } static String quotedCompound(List<String> strings); static String quoteIdentifier(final String id); static boolean isKeyword(String id); sta... |
@Test public void testWrite() throws IOException { OptimisticByteOutput byteOutput = new OptimisticByteOutput(smallData.length); for (byte b : smallData) { byteOutput.write(b); } byte[] outputData = byteOutput.toByteArray(); assertNotSame(smallData, outputData); assertArrayEquals(smallData, outputData); } | @Override public void write(byte value) { checkArray(); arrayReference[arrayOffset++] = value; } | OptimisticByteOutput extends ByteOutput { @Override public void write(byte value) { checkArray(); arrayReference[arrayOffset++] = value; } } | OptimisticByteOutput extends ByteOutput { @Override public void write(byte value) { checkArray(); arrayReference[arrayOffset++] = value; } OptimisticByteOutput(int payloadSize); } | OptimisticByteOutput extends ByteOutput { @Override public void write(byte value) { checkArray(); arrayReference[arrayOffset++] = value; } OptimisticByteOutput(int payloadSize); @Override void write(byte value); @Override void write(byte[] value, int offset, int length); @Override void writeLazy(byte[] value, int offse... | OptimisticByteOutput extends ByteOutput { @Override public void write(byte value) { checkArray(); arrayReference[arrayOffset++] = value; } OptimisticByteOutput(int payloadSize); @Override void write(byte value); @Override void write(byte[] value, int offset, int length); @Override void writeLazy(byte[] value, int offse... |
@Test public void testLiteralByteString() throws Exception { ByteString literal = ByteString.copyFrom(smallData); OptimisticByteOutput byteOutput = new OptimisticByteOutput(literal.size()); UnsafeByteOperations.unsafeWriteTo(literal, byteOutput); byte[] array = (byte[]) FieldUtils.readField(literal, "bytes", true); ass... | public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } | OptimisticByteOutput extends ByteOutput { public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } } | OptimisticByteOutput extends ByteOutput { public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } OptimisticByteOutput(int payloadSize); } | OptimisticByteOutput extends ByteOutput { public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } OptimisticByteOutput(int payloadSize); @Override vo... | OptimisticByteOutput extends ByteOutput { public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } OptimisticByteOutput(int payloadSize); @Override vo... |
@Test public void testRopeByteStringWithZeroOnLeft() throws Exception { ByteString literal = ByteString.copyFrom(smallData); ByteString data = (ByteString) NEW_ROPE_BYTE_STRING_INSTANCE.invoke(null, ByteString.EMPTY, literal); OptimisticByteOutput byteOutput = new OptimisticByteOutput(smallData.length); UnsafeByteOpera... | public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } | OptimisticByteOutput extends ByteOutput { public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } } | OptimisticByteOutput extends ByteOutput { public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } OptimisticByteOutput(int payloadSize); } | OptimisticByteOutput extends ByteOutput { public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } OptimisticByteOutput(int payloadSize); @Override vo... | OptimisticByteOutput extends ByteOutput { public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } OptimisticByteOutput(int payloadSize); @Override vo... |
@Test public void testRopeByteStringWithZeroOnRight() throws Exception { ByteString literal = ByteString.copyFrom(smallData); ByteString data = (ByteString) NEW_ROPE_BYTE_STRING_INSTANCE.invoke(null, literal, ByteString.EMPTY); OptimisticByteOutput byteOutput = new OptimisticByteOutput(smallData.length); UnsafeByteOper... | public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } | OptimisticByteOutput extends ByteOutput { public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } } | OptimisticByteOutput extends ByteOutput { public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } OptimisticByteOutput(int payloadSize); } | OptimisticByteOutput extends ByteOutput { public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } OptimisticByteOutput(int payloadSize); @Override vo... | OptimisticByteOutput extends ByteOutput { public byte[] toByteArray() { if (payloadSize == 0) { return arrayReference != null ? arrayReference : EMPTY; } Preconditions.checkState(arrayOffset == payloadSize, "Byte payload not fully received."); return arrayReference; } OptimisticByteOutput(int payloadSize); @Override vo... |
@Test public void testPathComponents() throws Exception { assertEquals(ImmutableList.of("a", "b", "c"), PathUtils.toPathComponents(Path.of("/a/b/c"))); assertEquals(ImmutableList.of("a", "b", "c"), PathUtils.toPathComponents(Path.of("a/b/c"))); assertEquals(ImmutableList.of("a", "b", "c/"), PathUtils.toPathComponents(P... | public static List<String> toPathComponents(String fsPath) { if (fsPath == null ) { return EMPTY_SCHEMA_PATHS; } final StrTokenizer tokenizer = new StrTokenizer(fsPath, SLASH_CHAR, SqlUtils.QUOTE).setIgnoreEmptyTokens(true); return tokenizer.getTokenList(); } | PathUtils { public static List<String> toPathComponents(String fsPath) { if (fsPath == null ) { return EMPTY_SCHEMA_PATHS; } final StrTokenizer tokenizer = new StrTokenizer(fsPath, SLASH_CHAR, SqlUtils.QUOTE).setIgnoreEmptyTokens(true); return tokenizer.getTokenList(); } } | PathUtils { public static List<String> toPathComponents(String fsPath) { if (fsPath == null ) { return EMPTY_SCHEMA_PATHS; } final StrTokenizer tokenizer = new StrTokenizer(fsPath, SLASH_CHAR, SqlUtils.QUOTE).setIgnoreEmptyTokens(true); return tokenizer.getTokenList(); } } | PathUtils { public static List<String> toPathComponents(String fsPath) { if (fsPath == null ) { return EMPTY_SCHEMA_PATHS; } final StrTokenizer tokenizer = new StrTokenizer(fsPath, SLASH_CHAR, SqlUtils.QUOTE).setIgnoreEmptyTokens(true); return tokenizer.getTokenList(); } static Path toFSPath(final List<String> schemaP... | PathUtils { public static List<String> toPathComponents(String fsPath) { if (fsPath == null ) { return EMPTY_SCHEMA_PATHS; } final StrTokenizer tokenizer = new StrTokenizer(fsPath, SLASH_CHAR, SqlUtils.QUOTE).setIgnoreEmptyTokens(true); return tokenizer.getTokenList(); } static Path toFSPath(final List<String> schemaP... |
@Test public void testFSPathToSchemaPath() throws Exception { assertEquals("a.b.c", PathUtils.toDottedPath(Path.of("/a/b/c"))); assertEquals("a.b.c", PathUtils.toDottedPath(Path.of("a/b/c"))); assertEquals("a.b.\"c.json\"", PathUtils.toDottedPath(Path.of("/a/b/c.json"))); assertEquals("\"c.json\"", PathUtils.toDottedPa... | public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } | PathUtils { public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } } | PathUtils { public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } } | PathUtils { public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } static Path toFSPath(final List<String> schemaPath); static String toFSPathString(final List<String> schemaPath); static Path toFSPathSkipRoot(final List<String> schemaPath, final String root); static Pat... | PathUtils { public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } static Path toFSPath(final List<String> schemaPath); static String toFSPathString(final List<String> schemaPath); static Path toFSPathSkipRoot(final List<String> schemaPath, final String root); static Pat... |
@Test public void ruleSuggestionsSelectEndingText() { Selection selection = new Selection("col", "There are 20 types of people", 22, 6); List<ReplacePatternRule> rules = recommender.getRules(selection, TEXT); assertEquals(4, rules.size()); compare(ReplaceSelectionType.CONTAINS, "people", true, rules.get(0)); compare(Re... | @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns"); List<ReplacePatternRule> rules = new ArrayList<>(); if (selection.ge... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... |
@Test public void testToFSPath() throws Exception { assertEquals(Path.of("/a/b/c"), PathUtils.toFSPath("a.b.c")); assertEquals(Path.of("/a/b"), PathUtils.toFSPath("a.b")); assertEquals(Path.of("/c.txt"), PathUtils.toFSPath("\"c.txt\"")); assertEquals(Path.of("/a/b/c.txt"), PathUtils.toFSPath("a.b.\"c.txt\"")); } | public static Path toFSPath(final List<String> schemaPath) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } return ROOT_PATH.resolve(PATH_JOINER.join(schemaPath)); } | PathUtils { public static Path toFSPath(final List<String> schemaPath) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } return ROOT_PATH.resolve(PATH_JOINER.join(schemaPath)); } } | PathUtils { public static Path toFSPath(final List<String> schemaPath) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } return ROOT_PATH.resolve(PATH_JOINER.join(schemaPath)); } } | PathUtils { public static Path toFSPath(final List<String> schemaPath) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } return ROOT_PATH.resolve(PATH_JOINER.join(schemaPath)); } static Path toFSPath(final List<String> schemaPath); static String toFSPathString(final List<String> schemaPath); stat... | PathUtils { public static Path toFSPath(final List<String> schemaPath) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } return ROOT_PATH.resolve(PATH_JOINER.join(schemaPath)); } static Path toFSPath(final List<String> schemaPath); static String toFSPathString(final List<String> schemaPath); stat... |
@Test public void testHybridSchemaPathToFSPath() throws Exception { assertEquals(Path.of("/dfs/tmp/a/b/c"), PathUtils.toFSPath("dfs.tmp.\"a/b/c")); assertEquals(Path.of("/dfs/tmp/a/b/c.json"), PathUtils.toFSPath("dfs.tmp.\"a/b/c.json")); assertEquals(Path.of("/dfs/tmp/a.txt"), PathUtils.toFSPath("dfs.tmp.\"a.txt")); } | public static Path toFSPath(final List<String> schemaPath) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } return ROOT_PATH.resolve(PATH_JOINER.join(schemaPath)); } | PathUtils { public static Path toFSPath(final List<String> schemaPath) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } return ROOT_PATH.resolve(PATH_JOINER.join(schemaPath)); } } | PathUtils { public static Path toFSPath(final List<String> schemaPath) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } return ROOT_PATH.resolve(PATH_JOINER.join(schemaPath)); } } | PathUtils { public static Path toFSPath(final List<String> schemaPath) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } return ROOT_PATH.resolve(PATH_JOINER.join(schemaPath)); } static Path toFSPath(final List<String> schemaPath); static String toFSPathString(final List<String> schemaPath); stat... | PathUtils { public static Path toFSPath(final List<String> schemaPath) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } return ROOT_PATH.resolve(PATH_JOINER.join(schemaPath)); } static Path toFSPath(final List<String> schemaPath); static String toFSPathString(final List<String> schemaPath); stat... |
@Test public void testToFSPathSkipRoot() throws Exception { assertEquals(Path.of("/b/c"), PathUtils.toFSPathSkipRoot(Arrays.asList("a", "b", "c"), "a")); assertEquals(Path.of("/a/b/c"), PathUtils.toFSPathSkipRoot(Arrays.asList("a", "b", "c"), "z")); assertEquals(Path.of("/a/b/c"), PathUtils.toFSPathSkipRoot(Arrays.asLi... | public static Path toFSPathSkipRoot(final List<String> schemaPath, final String root) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } if (root == null || !root.equals(schemaPath.get(0))) { return toFSPath(schemaPath); } else { return toFSPath(schemaPath.subList(1, schemaPath.size())); } } | PathUtils { public static Path toFSPathSkipRoot(final List<String> schemaPath, final String root) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } if (root == null || !root.equals(schemaPath.get(0))) { return toFSPath(schemaPath); } else { return toFSPath(schemaPath.subList(1, schemaPath.size()))... | PathUtils { public static Path toFSPathSkipRoot(final List<String> schemaPath, final String root) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } if (root == null || !root.equals(schemaPath.get(0))) { return toFSPath(schemaPath); } else { return toFSPath(schemaPath.subList(1, schemaPath.size()))... | PathUtils { public static Path toFSPathSkipRoot(final List<String> schemaPath, final String root) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } if (root == null || !root.equals(schemaPath.get(0))) { return toFSPath(schemaPath); } else { return toFSPath(schemaPath.subList(1, schemaPath.size()))... | PathUtils { public static Path toFSPathSkipRoot(final List<String> schemaPath, final String root) { if (schemaPath == null || schemaPath.isEmpty()) { return ROOT_PATH; } if (root == null || !root.equals(schemaPath.get(0))) { return toFSPath(schemaPath); } else { return toFSPath(schemaPath.subList(1, schemaPath.size()))... |
@Test public void toDottedPathWithCommonPrefix() throws Exception { assertEquals("d", PathUtils.toDottedPath(Path.of("/a/b/c"), Path.of("/a/b/c/d"))); assertEquals("b.c.d", PathUtils.toDottedPath(Path.of("/a"), Path.of("/a/b/c/d"))); assertEquals("a.b.c.d", PathUtils.toDottedPath(Path.of("/"), Path.of("/a/b/c/d"))); as... | public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } | PathUtils { public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } } | PathUtils { public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } } | PathUtils { public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } static Path toFSPath(final List<String> schemaPath); static String toFSPathString(final List<String> schemaPath); static Path toFSPathSkipRoot(final List<String> schemaPath, final String root); static Pat... | PathUtils { public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } static Path toFSPath(final List<String> schemaPath); static String toFSPathString(final List<String> schemaPath); static Path toFSPathSkipRoot(final List<String> schemaPath, final String root); static Pat... |
@Test public void toDottedPathWithInvalidPrefix() throws Exception { try { PathUtils.toDottedPath(Path.of("/p/q/"), Path.of("/a/b/c/d/e.json")); fail("constructing relative path of child /a/b/c/d/e.json with parent /p/q should fail"); } catch (IOException e) { } } | public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } | PathUtils { public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } } | PathUtils { public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } } | PathUtils { public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } static Path toFSPath(final List<String> schemaPath); static String toFSPathString(final List<String> schemaPath); static Path toFSPathSkipRoot(final List<String> schemaPath, final String root); static Pat... | PathUtils { public static String toDottedPath(Path fsPath) { return constructFullPath(toPathComponents(fsPath)); } static Path toFSPath(final List<String> schemaPath); static String toFSPathString(final List<String> schemaPath); static Path toFSPathSkipRoot(final List<String> schemaPath, final String root); static Pat... |
@Test public void testRelativePath() throws Exception { assertEquals("a", PathUtils.relativePath(Path.of("/a"), Path.of("/"))); assertEquals("b", PathUtils.relativePath(Path.of("/a/b"), Path.of("/a"))); assertEquals("b/c.json", PathUtils.relativePath(Path.of("/a/b/c.json"), Path.of("/a"))); assertEquals("c/d/e", PathUt... | public static String relativePath(Path absolutePath, Path basePath) { Preconditions.checkArgument(absolutePath.isAbsolute(), "absolutePath must be an absolute path"); Preconditions.checkArgument(basePath.isAbsolute(), "basePath must be an absolute path"); List<String> absolutePathComponents = Lists.newArrayList(toPathC... | PathUtils { public static String relativePath(Path absolutePath, Path basePath) { Preconditions.checkArgument(absolutePath.isAbsolute(), "absolutePath must be an absolute path"); Preconditions.checkArgument(basePath.isAbsolute(), "basePath must be an absolute path"); List<String> absolutePathComponents = Lists.newArray... | PathUtils { public static String relativePath(Path absolutePath, Path basePath) { Preconditions.checkArgument(absolutePath.isAbsolute(), "absolutePath must be an absolute path"); Preconditions.checkArgument(basePath.isAbsolute(), "basePath must be an absolute path"); List<String> absolutePathComponents = Lists.newArray... | PathUtils { public static String relativePath(Path absolutePath, Path basePath) { Preconditions.checkArgument(absolutePath.isAbsolute(), "absolutePath must be an absolute path"); Preconditions.checkArgument(basePath.isAbsolute(), "basePath must be an absolute path"); List<String> absolutePathComponents = Lists.newArray... | PathUtils { public static String relativePath(Path absolutePath, Path basePath) { Preconditions.checkArgument(absolutePath.isAbsolute(), "absolutePath must be an absolute path"); Preconditions.checkArgument(basePath.isAbsolute(), "basePath must be an absolute path"); List<String> absolutePathComponents = Lists.newArray... |
@Test public void testRemoveLeadingSlash() { assertEquals("", PathUtils.removeLeadingSlash("")); assertEquals("", PathUtils.removeLeadingSlash("/")); assertEquals("aaaa", PathUtils.removeLeadingSlash("/aaaa")); assertEquals("aaaa/bbb", PathUtils.removeLeadingSlash("/aaaa/bbb")); assertEquals("aaaa/bbb", PathUtils.remov... | public static String removeLeadingSlash(String path) { if (path.length() > 0 && path.charAt(0) == '/') { String newPath = path.substring(1); return removeLeadingSlash(newPath); } else { return path; } } | PathUtils { public static String removeLeadingSlash(String path) { if (path.length() > 0 && path.charAt(0) == '/') { String newPath = path.substring(1); return removeLeadingSlash(newPath); } else { return path; } } } | PathUtils { public static String removeLeadingSlash(String path) { if (path.length() > 0 && path.charAt(0) == '/') { String newPath = path.substring(1); return removeLeadingSlash(newPath); } else { return path; } } } | PathUtils { public static String removeLeadingSlash(String path) { if (path.length() > 0 && path.charAt(0) == '/') { String newPath = path.substring(1); return removeLeadingSlash(newPath); } else { return path; } } static Path toFSPath(final List<String> schemaPath); static String toFSPathString(final List<String> sch... | PathUtils { public static String removeLeadingSlash(String path) { if (path.length() > 0 && path.charAt(0) == '/') { String newPath = path.substring(1); return removeLeadingSlash(newPath); } else { return path; } } static Path toFSPath(final List<String> schemaPath); static String toFSPathString(final List<String> sch... |
@Test public void testVerifyNoAccessOutsideBase() { PathUtils.verifyNoAccessOutsideBase(Path.of("/"), Path.of("/")); PathUtils.verifyNoAccessOutsideBase(Path.of("/"), Path.of("/a")); PathUtils.verifyNoAccessOutsideBase(Path.of("/"), Path.of("/a/b")); PathUtils.verifyNoAccessOutsideBase(Path.of("/a/"), Path.of("/a")); P... | public static void verifyNoAccessOutsideBase(Path basePath, Path givenPath) { if (!checkNoAccessOutsideBase(basePath, givenPath)) { throw UserException.permissionError() .message("Not allowed to access files outside of the source root") .addContext("Source root", Path.withoutSchemeAndAuthority(basePath).toString()) .ad... | PathUtils { public static void verifyNoAccessOutsideBase(Path basePath, Path givenPath) { if (!checkNoAccessOutsideBase(basePath, givenPath)) { throw UserException.permissionError() .message("Not allowed to access files outside of the source root") .addContext("Source root", Path.withoutSchemeAndAuthority(basePath).toS... | PathUtils { public static void verifyNoAccessOutsideBase(Path basePath, Path givenPath) { if (!checkNoAccessOutsideBase(basePath, givenPath)) { throw UserException.permissionError() .message("Not allowed to access files outside of the source root") .addContext("Source root", Path.withoutSchemeAndAuthority(basePath).toS... | PathUtils { public static void verifyNoAccessOutsideBase(Path basePath, Path givenPath) { if (!checkNoAccessOutsideBase(basePath, givenPath)) { throw UserException.permissionError() .message("Not allowed to access files outside of the source root") .addContext("Source root", Path.withoutSchemeAndAuthority(basePath).toS... | PathUtils { public static void verifyNoAccessOutsideBase(Path basePath, Path givenPath) { if (!checkNoAccessOutsideBase(basePath, givenPath)) { throw UserException.permissionError() .message("Not allowed to access files outside of the source root") .addContext("Source root", Path.withoutSchemeAndAuthority(basePath).toS... |
@Test public void ruleSuggestionsSelectAllText() { Selection selection = new Selection("col", "There are 20 types of people", 0, 28); List<ReplacePatternRule> rules = recommender.getRules(selection, TEXT); assertEquals(8, rules.size()); compare(ReplaceSelectionType.CONTAINS, "There are 20 types of people", true, rules.... | @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns"); List<ReplacePatternRule> rules = new ArrayList<>(); if (selection.ge... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... |
@SuppressWarnings("SelfComparison") @Test public void testCompareTo() { assertTrue(v1.compareTo(v1) == 0); assertTrue(v1.compareTo(v2) < 0); assertTrue(v1.compareTo(v3) < 0); assertTrue(v1.compareTo(v4) == 0); assertTrue(v1.compareTo(v5) < 0); assertTrue(v1.compareTo(new Version("1.2", 1, 2, 0, 0, "")) > 0); } | @Override public int compareTo(Version o) { Preconditions.checkNotNull(o); return ComparisonChain.start() .compare(this.major, o.major) .compare(this.minor, o.minor) .compare(this.patch, o.patch) .compare(this.buildNumber, o.buildNumber) .compare(this.lcQualifier, o.lcQualifier, QUALIFIER_COMPARATOR) .result(); } | Version implements Comparable<Version> { @Override public int compareTo(Version o) { Preconditions.checkNotNull(o); return ComparisonChain.start() .compare(this.major, o.major) .compare(this.minor, o.minor) .compare(this.patch, o.patch) .compare(this.buildNumber, o.buildNumber) .compare(this.lcQualifier, o.lcQualifier,... | Version implements Comparable<Version> { @Override public int compareTo(Version o) { Preconditions.checkNotNull(o); return ComparisonChain.start() .compare(this.major, o.major) .compare(this.minor, o.minor) .compare(this.patch, o.patch) .compare(this.buildNumber, o.buildNumber) .compare(this.lcQualifier, o.lcQualifier,... | Version implements Comparable<Version> { @Override public int compareTo(Version o) { Preconditions.checkNotNull(o); return ComparisonChain.start() .compare(this.major, o.major) .compare(this.minor, o.minor) .compare(this.patch, o.patch) .compare(this.buildNumber, o.buildNumber) .compare(this.lcQualifier, o.lcQualifier,... | Version implements Comparable<Version> { @Override public int compareTo(Version o) { Preconditions.checkNotNull(o); return ComparisonChain.start() .compare(this.major, o.major) .compare(this.minor, o.minor) .compare(this.patch, o.patch) .compare(this.buildNumber, o.buildNumber) .compare(this.lcQualifier, o.lcQualifier,... |
@Test public void testSet() throws Exception { stringLocalValue.set("value1"); intLocalValue.set(1); assertEquals("value1", stringLocalValue.get().get()); assertEquals(new Integer(1), intLocalValue.get().get()); stringLocalValue.set("value2"); intLocalValue.set(2); assertEquals("value2", stringLocalValue.get().get()); ... | public void set(T value) { Preconditions.checkNotNull(value, "LocalValue cannot be set to null"); doSet(value); } | LocalValue { public void set(T value) { Preconditions.checkNotNull(value, "LocalValue cannot be set to null"); doSet(value); } } | LocalValue { public void set(T value) { Preconditions.checkNotNull(value, "LocalValue cannot be set to null"); doSet(value); } LocalValue(); } | LocalValue { public void set(T value) { Preconditions.checkNotNull(value, "LocalValue cannot be set to null"); doSet(value); } LocalValue(); @SuppressWarnings("unchecked") Optional<T> get(); void set(T value); void clear(); static LocalValues save(); static void restore(LocalValues localValues); } | LocalValue { public void set(T value) { Preconditions.checkNotNull(value, "LocalValue cannot be set to null"); doSet(value); } LocalValue(); @SuppressWarnings("unchecked") Optional<T> get(); void set(T value); void clear(); static LocalValues save(); static void restore(LocalValues localValues); } |
@Test public void testClear() { stringLocalValue.set("value1"); intLocalValue.set(1); stringLocalValue.clear(); intLocalValue.clear(); assertFalse(stringLocalValue.get().isPresent()); assertFalse(intLocalValue.get().isPresent()); } | public void clear() { doSet(null); } | LocalValue { public void clear() { doSet(null); } } | LocalValue { public void clear() { doSet(null); } LocalValue(); } | LocalValue { public void clear() { doSet(null); } LocalValue(); @SuppressWarnings("unchecked") Optional<T> get(); void set(T value); void clear(); static LocalValues save(); static void restore(LocalValues localValues); } | LocalValue { public void clear() { doSet(null); } LocalValue(); @SuppressWarnings("unchecked") Optional<T> get(); void set(T value); void clear(); static LocalValues save(); static void restore(LocalValues localValues); } |
@Test public void checkMaxDirectMemory() { assertThat(VM.maxDirectMemory(arguments), is(maxDirectMemory)); } | private static final long maxDirectMemory() { try { return invokeMaxDirectMemory("sun.misc.VM"); } catch (ReflectiveOperationException ignored) { } try { return invokeMaxDirectMemory("jdk.internal.misc.VM"); } catch (ReflectiveOperationException ignored) { } final List<String> inputArguments = ManagementFactory.getRunt... | VM { private static final long maxDirectMemory() { try { return invokeMaxDirectMemory("sun.misc.VM"); } catch (ReflectiveOperationException ignored) { } try { return invokeMaxDirectMemory("jdk.internal.misc.VM"); } catch (ReflectiveOperationException ignored) { } final List<String> inputArguments = ManagementFactory.ge... | VM { private static final long maxDirectMemory() { try { return invokeMaxDirectMemory("sun.misc.VM"); } catch (ReflectiveOperationException ignored) { } try { return invokeMaxDirectMemory("jdk.internal.misc.VM"); } catch (ReflectiveOperationException ignored) { } final List<String> inputArguments = ManagementFactory.ge... | VM { private static final long maxDirectMemory() { try { return invokeMaxDirectMemory("sun.misc.VM"); } catch (ReflectiveOperationException ignored) { } try { return invokeMaxDirectMemory("jdk.internal.misc.VM"); } catch (ReflectiveOperationException ignored) { } final List<String> inputArguments = ManagementFactory.ge... | VM { private static final long maxDirectMemory() { try { return invokeMaxDirectMemory("sun.misc.VM"); } catch (ReflectiveOperationException ignored) { } try { return invokeMaxDirectMemory("jdk.internal.misc.VM"); } catch (ReflectiveOperationException ignored) { } final List<String> inputArguments = ManagementFactory.ge... |
@Test public void checkDebugEnabled() { assertThat(VM.isDebugEnabled(arguments), is(debugEnabled)); } | public static boolean isDebugEnabled() { return IS_DEBUG; } | VM { public static boolean isDebugEnabled() { return IS_DEBUG; } } | VM { public static boolean isDebugEnabled() { return IS_DEBUG; } private VM(); } | VM { public static boolean isDebugEnabled() { return IS_DEBUG; } private VM(); static boolean isDebugEnabled(); static int availableProcessors(); static long getMaxDirectMemory(); static long getMaxHeapMemory(); static boolean isMacOSHost(); static boolean isWindowsHost(); } | VM { public static boolean isDebugEnabled() { return IS_DEBUG; } private VM(); static boolean isDebugEnabled(); static int availableProcessors(); static long getMaxDirectMemory(); static long getMaxHeapMemory(); static boolean isMacOSHost(); static boolean isWindowsHost(); static final String DREMIO_CPU_AVAILABLE_PROP... |
@Test public void testIsNull() throws Exception { assertNotNull(accessor.getObject(0)); assertNotNull(accessor.getTime(0, PST_CALENDAR)); assertNull(accessor.getObject(1)); assertNull(accessor.getTime(1, PST_CALENDAR)); } | @Override public boolean isNull(int index) { return ac.isNull(index); } | TimeMilliAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return ac.isNull(index); } } | TimeMilliAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return ac.isNull(index); } TimeMilliAccessor(TimeMilliVector vector, TimeZone defaultTZ); } | TimeMilliAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return ac.isNull(index); } TimeMilliAccessor(TimeMilliVector vector, TimeZone defaultTZ); @Override MajorType getType(); @Override boolean isNull(int index); @Override Class<?> getObjectClass(); @Override Object getObject(int i... | TimeMilliAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return ac.isNull(index); } TimeMilliAccessor(TimeMilliVector vector, TimeZone defaultTZ); @Override MajorType getType(); @Override boolean isNull(int index); @Override Class<?> getObjectClass(); @Override Object getObject(int i... |
@Test public void testGetObject() throws Exception { assertEquals(new TimePrintMillis(NON_NULL_VALUE), accessor.getObject(0)); } | @Override public Object getObject(int index) { return getTime(index, defaultTimeZone); } | TimeMilliAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) { return getTime(index, defaultTimeZone); } } | TimeMilliAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) { return getTime(index, defaultTimeZone); } TimeMilliAccessor(TimeMilliVector vector, TimeZone defaultTZ); } | TimeMilliAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) { return getTime(index, defaultTimeZone); } TimeMilliAccessor(TimeMilliVector vector, TimeZone defaultTZ); @Override MajorType getType(); @Override boolean isNull(int index); @Override Class<?> getObjectClass(); @Override Objec... | TimeMilliAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) { return getTime(index, defaultTimeZone); } TimeMilliAccessor(TimeMilliVector vector, TimeZone defaultTZ); @Override MajorType getType(); @Override boolean isNull(int index); @Override Class<?> getObjectClass(); @Override Objec... |
@Test(expected=NullPointerException.class) public void testNullCalendar() throws InvalidAccessException { accessor.getTime(0, null); } | @Override public Time getTime(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve time."); return getTime(index, calendar.getTimeZone()); } | TimeMilliAccessor extends AbstractSqlAccessor { @Override public Time getTime(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve time."); return getTime(index, calendar.getTimeZone()); } } | TimeMilliAccessor extends AbstractSqlAccessor { @Override public Time getTime(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve time."); return getTime(index, calendar.getTimeZone()); } TimeMilliAccessor(TimeMilliVector vector, TimeZone defaultTZ); } | TimeMilliAccessor extends AbstractSqlAccessor { @Override public Time getTime(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve time."); return getTime(index, calendar.getTimeZone()); } TimeMilliAccessor(TimeMilliVector vector, TimeZone defaultTZ); @... | TimeMilliAccessor extends AbstractSqlAccessor { @Override public Time getTime(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve time."); return getTime(index, calendar.getTimeZone()); } TimeMilliAccessor(TimeMilliVector vector, TimeZone defaultTZ); @... |
@Test public void testGetTime() throws Exception { assertEquals( new TimePrintMillis(LocalDateTime.of(LocalDate.now(), LocalTime.of(8, 14, 07, (int)TimeUnit.MILLISECONDS.toNanos(234)))), accessor.getTime(0, PST_CALENDAR)); assertEquals(new TimePrintMillis(NON_NULL_VALUE), accessor.getTime(0, UTC_CALENDAR)); } | @Override public Time getTime(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve time."); return getTime(index, calendar.getTimeZone()); } | TimeMilliAccessor extends AbstractSqlAccessor { @Override public Time getTime(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve time."); return getTime(index, calendar.getTimeZone()); } } | TimeMilliAccessor extends AbstractSqlAccessor { @Override public Time getTime(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve time."); return getTime(index, calendar.getTimeZone()); } TimeMilliAccessor(TimeMilliVector vector, TimeZone defaultTZ); } | TimeMilliAccessor extends AbstractSqlAccessor { @Override public Time getTime(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve time."); return getTime(index, calendar.getTimeZone()); } TimeMilliAccessor(TimeMilliVector vector, TimeZone defaultTZ); @... | TimeMilliAccessor extends AbstractSqlAccessor { @Override public Time getTime(int index, Calendar calendar) { Preconditions.checkNotNull(calendar, "Invalid calendar used when attempting to retrieve time."); return getTime(index, calendar.getTimeZone()); } TimeMilliAccessor(TimeMilliVector vector, TimeZone defaultTZ); @... |
@Test public void testIsNull() throws Exception { assertNotNull(accessor.getObject(0)); assertNotNull(accessor.getDate(0, PST_CALENDAR)); assertNull(accessor.getObject(2)); assertNull(accessor.getDate(2, PST_CALENDAR)); } | @Override public boolean isNull(int index) { return ac.isNull(index); } | DateMilliAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return ac.isNull(index); } } | DateMilliAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return ac.isNull(index); } DateMilliAccessor(DateMilliVector vector, TimeZone defaultTZ); } | DateMilliAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return ac.isNull(index); } DateMilliAccessor(DateMilliVector vector, TimeZone defaultTZ); @Override MajorType getType(); @Override boolean isNull(int index); @Override Class<?> getObjectClass(); @Override Object getObject(int i... | DateMilliAccessor extends AbstractSqlAccessor { @Override public boolean isNull(int index) { return ac.isNull(index); } DateMilliAccessor(DateMilliVector vector, TimeZone defaultTZ); @Override MajorType getType(); @Override boolean isNull(int index); @Override Class<?> getObjectClass(); @Override Object getObject(int i... |
@Test public void ruleSuggestionsSelectNumberAtTheEnd() { Selection selection = new Selection("col", "883 N Shoreline Blvd, Mountain View, CA 94043", 40, 5); List<ReplacePatternRule> rules = recommender.getRules(selection, TEXT); assertEquals(3, rules.size()); compare(ReplaceSelectionType.CONTAINS, "94043", false, rule... | @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns"); List<ReplacePatternRule> rules = new ArrayList<>(); if (selection.ge... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... | ReplaceRecommender extends Recommender<ReplacePatternRule, Selection> { @Override public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) { Preconditions.checkArgument(selColType == DataType.TEXT, "Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns... |
@Test public void testGetObject() throws Exception { assertEquals(new Date(72, 10, 4), accessor.getObject(0)); } | @Override public Object getObject(int index) { return getDate(index, defaultTimeZone); } | DateMilliAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) { return getDate(index, defaultTimeZone); } } | DateMilliAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) { return getDate(index, defaultTimeZone); } DateMilliAccessor(DateMilliVector vector, TimeZone defaultTZ); } | DateMilliAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) { return getDate(index, defaultTimeZone); } DateMilliAccessor(DateMilliVector vector, TimeZone defaultTZ); @Override MajorType getType(); @Override boolean isNull(int index); @Override Class<?> getObjectClass(); @Override Objec... | DateMilliAccessor extends AbstractSqlAccessor { @Override public Object getObject(int index) { return getDate(index, defaultTimeZone); } DateMilliAccessor(DateMilliVector vector, TimeZone defaultTZ); @Override MajorType getType(); @Override boolean isNull(int index); @Override Class<?> getObjectClass(); @Override Objec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.