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 test_return_empty_when_no_value() throws Exception { SensorContextTester context = SensorContextTester.create(new File(".")); List<File> reportFiles = ExternalReportProvider.getReportFiles(context, EXTERNAL_REPORTS_PROPERTY); assertThat(reportFiles).isEmpty(); assertThat(logTester.logs()).isEmpty(); }
public static List<File> getReportFiles(SensorContext context, String externalReportsProperty) { boolean externalIssuesSupported = context.getSonarQubeVersion().isGreaterThanOrEqual(Version.create(7, 2)); String[] reportPaths = context.config().getStringArray(externalReportsProperty); if (reportPaths.length == 0) { ret...
ExternalReportProvider { public static List<File> getReportFiles(SensorContext context, String externalReportsProperty) { boolean externalIssuesSupported = context.getSonarQubeVersion().isGreaterThanOrEqual(Version.create(7, 2)); String[] reportPaths = context.config().getStringArray(externalReportsProperty); if (repor...
ExternalReportProvider { public static List<File> getReportFiles(SensorContext context, String externalReportsProperty) { boolean externalIssuesSupported = context.getSonarQubeVersion().isGreaterThanOrEqual(Version.create(7, 2)); String[] reportPaths = context.config().getStringArray(externalReportsProperty); if (repor...
ExternalReportProvider { public static List<File> getReportFiles(SensorContext context, String externalReportsProperty) { boolean externalIssuesSupported = context.getSonarQubeVersion().isGreaterThanOrEqual(Version.create(7, 2)); String[] reportPaths = context.config().getStringArray(externalReportsProperty); if (repor...
ExternalReportProvider { public static List<File> getReportFiles(SensorContext context, String externalReportsProperty) { boolean externalIssuesSupported = context.getSonarQubeVersion().isGreaterThanOrEqual(Version.create(7, 2)); String[] reportPaths = context.config().getStringArray(externalReportsProperty); if (repor...
@Test public void test_resolve_abs_and_relative() throws Exception { SensorContextTester context = SensorContextTester.create(new File("src/test/resources")); context.settings().setProperty(EXTERNAL_REPORTS_PROPERTY, "foo.out, " + new File("src/test/resources/bar.out").getAbsolutePath()); List<File> reportFiles = Exter...
public static List<File> getReportFiles(SensorContext context, String externalReportsProperty) { boolean externalIssuesSupported = context.getSonarQubeVersion().isGreaterThanOrEqual(Version.create(7, 2)); String[] reportPaths = context.config().getStringArray(externalReportsProperty); if (reportPaths.length == 0) { ret...
ExternalReportProvider { public static List<File> getReportFiles(SensorContext context, String externalReportsProperty) { boolean externalIssuesSupported = context.getSonarQubeVersion().isGreaterThanOrEqual(Version.create(7, 2)); String[] reportPaths = context.config().getStringArray(externalReportsProperty); if (repor...
ExternalReportProvider { public static List<File> getReportFiles(SensorContext context, String externalReportsProperty) { boolean externalIssuesSupported = context.getSonarQubeVersion().isGreaterThanOrEqual(Version.create(7, 2)); String[] reportPaths = context.config().getStringArray(externalReportsProperty); if (repor...
ExternalReportProvider { public static List<File> getReportFiles(SensorContext context, String externalReportsProperty) { boolean externalIssuesSupported = context.getSonarQubeVersion().isGreaterThanOrEqual(Version.create(7, 2)); String[] reportPaths = context.config().getStringArray(externalReportsProperty); if (repor...
ExternalReportProvider { public static List<File> getReportFiles(SensorContext context, String externalReportsProperty) { boolean externalIssuesSupported = context.getSonarQubeVersion().isGreaterThanOrEqual(Version.create(7, 2)); String[] reportPaths = context.config().getStringArray(externalReportsProperty); if (repor...
@Test public void scan() { ContainsDetector detector = new ContainsDetector(0.3, "++", "for("); assertThat(detector.scan("for (int i =0; i++; i<4) {")).isEqualTo(2); assertThat(detector.scan("String name;")).isZero(); }
@Override public int scan(String line) { String lineWithoutWhitespaces = StringUtils.deleteWhitespace(line); int matchers = 0; for (String str : strs) { matchers += StringUtils.countMatches(lineWithoutWhitespaces, str); } return matchers; }
ContainsDetector extends Detector { @Override public int scan(String line) { String lineWithoutWhitespaces = StringUtils.deleteWhitespace(line); int matchers = 0; for (String str : strs) { matchers += StringUtils.countMatches(lineWithoutWhitespaces, str); } return matchers; } }
ContainsDetector extends Detector { @Override public int scan(String line) { String lineWithoutWhitespaces = StringUtils.deleteWhitespace(line); int matchers = 0; for (String str : strs) { matchers += StringUtils.countMatches(lineWithoutWhitespaces, str); } return matchers; } ContainsDetector(double probability, String...
ContainsDetector extends Detector { @Override public int scan(String line) { String lineWithoutWhitespaces = StringUtils.deleteWhitespace(line); int matchers = 0; for (String str : strs) { matchers += StringUtils.countMatches(lineWithoutWhitespaces, str); } return matchers; } ContainsDetector(double probability, String...
ContainsDetector extends Detector { @Override public int scan(String line) { String lineWithoutWhitespaces = StringUtils.deleteWhitespace(line); int matchers = 0; for (String str : strs) { matchers += StringUtils.countMatches(lineWithoutWhitespaces, str); } return matchers; } ContainsDetector(double probability, String...
@Test public void scan() { EndWithDetector detector = new EndWithDetector(0.3, '}'); assertThat(detector.scan(" return true; }")).isOne(); assertThat(detector.scan("} catch(NullPointerException e) {")).isZero(); assertThat(detector.scan("} ")).isOne(); assertThat(detector.scan("}*")).isOne(); assertThat(detector.scan("...
@Override public int scan(String line) { for (int index = line.length() - 1; index >= 0; index--) { char character = line.charAt(index); for (char endOfLine : endOfLines) { if (character == endOfLine) { return 1; } } if (!Character.isWhitespace(character) && character != '*' && character != '/') { return 0; } } return ...
EndWithDetector extends Detector { @Override public int scan(String line) { for (int index = line.length() - 1; index >= 0; index--) { char character = line.charAt(index); for (char endOfLine : endOfLines) { if (character == endOfLine) { return 1; } } if (!Character.isWhitespace(character) && character != '*' && charac...
EndWithDetector extends Detector { @Override public int scan(String line) { for (int index = line.length() - 1; index >= 0; index--) { char character = line.charAt(index); for (char endOfLine : endOfLines) { if (character == endOfLine) { return 1; } } if (!Character.isWhitespace(character) && character != '*' && charac...
EndWithDetector extends Detector { @Override public int scan(String line) { for (int index = line.length() - 1; index >= 0; index--) { char character = line.charAt(index); for (char endOfLine : endOfLines) { if (character == endOfLine) { return 1; } } if (!Character.isWhitespace(character) && character != '*' && charac...
EndWithDetector extends Detector { @Override public int scan(String line) { for (int index = line.length() - 1; index >= 0; index--) { char character = line.charAt(index); for (char endOfLine : endOfLines) { if (character == endOfLine) { return 1; } } if (!Character.isWhitespace(character) && character != '*' && charac...
@Test public void scan() { CamelCaseDetector detector = new CamelCaseDetector(0.3); assertThat(detector.scan("isDog() or isCat()")).isOne(); assertThat(detector.scan("String name;")).isZero(); }
@Override public int scan(String line) { char previousChar = ' '; char indexChar; for (int i = 0; i < line.length(); i++) { indexChar = line.charAt(i); if (isLowerCaseThenUpperCase(previousChar, indexChar)) { return 1; } previousChar = indexChar; } return 0; }
CamelCaseDetector extends Detector { @Override public int scan(String line) { char previousChar = ' '; char indexChar; for (int i = 0; i < line.length(); i++) { indexChar = line.charAt(i); if (isLowerCaseThenUpperCase(previousChar, indexChar)) { return 1; } previousChar = indexChar; } return 0; } }
CamelCaseDetector extends Detector { @Override public int scan(String line) { char previousChar = ' '; char indexChar; for (int i = 0; i < line.length(); i++) { indexChar = line.charAt(i); if (isLowerCaseThenUpperCase(previousChar, indexChar)) { return 1; } previousChar = indexChar; } return 0; } CamelCaseDetector(doub...
CamelCaseDetector extends Detector { @Override public int scan(String line) { char previousChar = ' '; char indexChar; for (int i = 0; i < line.length(); i++) { indexChar = line.charAt(i); if (isLowerCaseThenUpperCase(previousChar, indexChar)) { return 1; } previousChar = indexChar; } return 0; } CamelCaseDetector(doub...
CamelCaseDetector extends Detector { @Override public int scan(String line) { char previousChar = ' '; char indexChar; for (int i = 0; i < line.length(); i++) { indexChar = line.charAt(i); if (isLowerCaseThenUpperCase(previousChar, indexChar)) { return 1; } previousChar = indexChar; } return 0; } CamelCaseDetector(doub...
@Test public void testNodeAttribute() throws Exception { XmlFile xmlFile = XmlFile.create( "<a attr='foo'>\n" + " <!-- comment -->\n" + " <b>world</b>\n" + "</a>"); Node aNode = xmlFile.getDocument().getFirstChild(); assertThat(XmlFile.nodeAttribute(aNode, "attr")).isNotNull(); assertThat(XmlFile.nodeAttribute(aNode, "...
@CheckForNull public static Node nodeAttribute(Node node, String attribute) { NamedNodeMap attributes = node.getAttributes(); if (attributes == null) { return null; } return attributes.getNamedItem(attribute); }
XmlFile { @CheckForNull public static Node nodeAttribute(Node node, String attribute) { NamedNodeMap attributes = node.getAttributes(); if (attributes == null) { return null; } return attributes.getNamedItem(attribute); } }
XmlFile { @CheckForNull public static Node nodeAttribute(Node node, String attribute) { NamedNodeMap attributes = node.getAttributes(); if (attributes == null) { return null; } return attributes.getNamedItem(attribute); } private XmlFile(InputFile inputFile); private XmlFile(String str); }
XmlFile { @CheckForNull public static Node nodeAttribute(Node node, String attribute) { NamedNodeMap attributes = node.getAttributes(); if (attributes == null) { return null; } return attributes.getNamedItem(attribute); } private XmlFile(InputFile inputFile); private XmlFile(String str); static XmlFile create(InputFi...
XmlFile { @CheckForNull public static Node nodeAttribute(Node node, String attribute) { NamedNodeMap attributes = node.getAttributes(); if (attributes == null) { return null; } return attributes.getNamedItem(attribute); } private XmlFile(InputFile inputFile); private XmlFile(String str); static XmlFile create(InputFi...
@Test public void scan() { KeywordsDetector detector = new KeywordsDetector(0.3, "public", "static"); assertThat(detector.scan("public static void main")).isEqualTo(2); assertThat(detector.scan("private(static} String name;")).isOne(); assertThat(detector.scan("publicstatic")).isZero(); assertThat(detector.scan("i++;")...
@Override public int scan(String line) { int matchers = 0; if (toUpperCase) { line = line.toUpperCase(Locale.getDefault()); } StringTokenizer tokenizer = new StringTokenizer(line, " \t(),{}"); while (tokenizer.hasMoreTokens()) { String word = tokenizer.nextToken(); if (keywords.contains(word)) { matchers++; } } return ...
KeywordsDetector extends Detector { @Override public int scan(String line) { int matchers = 0; if (toUpperCase) { line = line.toUpperCase(Locale.getDefault()); } StringTokenizer tokenizer = new StringTokenizer(line, " \t(),{}"); while (tokenizer.hasMoreTokens()) { String word = tokenizer.nextToken(); if (keywords.conta...
KeywordsDetector extends Detector { @Override public int scan(String line) { int matchers = 0; if (toUpperCase) { line = line.toUpperCase(Locale.getDefault()); } StringTokenizer tokenizer = new StringTokenizer(line, " \t(),{}"); while (tokenizer.hasMoreTokens()) { String word = tokenizer.nextToken(); if (keywords.conta...
KeywordsDetector extends Detector { @Override public int scan(String line) { int matchers = 0; if (toUpperCase) { line = line.toUpperCase(Locale.getDefault()); } StringTokenizer tokenizer = new StringTokenizer(line, " \t(),{}"); while (tokenizer.hasMoreTokens()) { String word = tokenizer.nextToken(); if (keywords.conta...
KeywordsDetector extends Detector { @Override public int scan(String line) { int matchers = 0; if (toUpperCase) { line = line.toUpperCase(Locale.getDefault()); } StringTokenizer tokenizer = new StringTokenizer(line, " \t(),{}"); while (tokenizer.hasMoreTokens()) { String word = tokenizer.nextToken(); if (keywords.conta...
@Test public void isLineOfCode() { CodeRecognizer cr = new CodeRecognizer(0.8, new FakeFootprint()); assertThat(cr.isLineOfCode("}")).isTrue(); assertThat(cr.isLineOfCode("squid")).isFalse(); }
public final boolean isLineOfCode(String line) { return recognition(line) - threshold > 0; }
CodeRecognizer { public final boolean isLineOfCode(String line) { return recognition(line) - threshold > 0; } }
CodeRecognizer { public final boolean isLineOfCode(String line) { return recognition(line) - threshold > 0; } CodeRecognizer(double threshold, LanguageFootprint language); }
CodeRecognizer { public final boolean isLineOfCode(String line) { return recognition(line) - threshold > 0; } CodeRecognizer(double threshold, LanguageFootprint language); final double recognition(String line); final List<String> extractCodeLines(List<String> lines); final boolean isLineOfCode(String line); }
CodeRecognizer { public final boolean isLineOfCode(String line) { return recognition(line) - threshold > 0; } CodeRecognizer(double threshold, LanguageFootprint language); final double recognition(String line); final List<String> extractCodeLines(List<String> lines); final boolean isLineOfCode(String line); }
@Test public void extractCodeLines() { CodeRecognizer cr = new CodeRecognizer(0.8, new FakeFootprint()); assertThat(cr.extractCodeLines(Arrays.asList("{", "squid"))).containsOnly("{"); }
public final List<String> extractCodeLines(List<String> lines) { List<String> codeLines = new ArrayList<>(); for (String line : lines) { if (recognition(line) >= threshold) { codeLines.add(line); } } return codeLines; }
CodeRecognizer { public final List<String> extractCodeLines(List<String> lines) { List<String> codeLines = new ArrayList<>(); for (String line : lines) { if (recognition(line) >= threshold) { codeLines.add(line); } } return codeLines; } }
CodeRecognizer { public final List<String> extractCodeLines(List<String> lines) { List<String> codeLines = new ArrayList<>(); for (String line : lines) { if (recognition(line) >= threshold) { codeLines.add(line); } } return codeLines; } CodeRecognizer(double threshold, LanguageFootprint language); }
CodeRecognizer { public final List<String> extractCodeLines(List<String> lines) { List<String> codeLines = new ArrayList<>(); for (String line : lines) { if (recognition(line) >= threshold) { codeLines.add(line); } } return codeLines; } CodeRecognizer(double threshold, LanguageFootprint language); final double recognit...
CodeRecognizer { public final List<String> extractCodeLines(List<String> lines) { List<String> codeLines = new ArrayList<>(); for (String line : lines) { if (recognition(line) >= threshold) { codeLines.add(line); } } return codeLines; } CodeRecognizer(double threshold, LanguageFootprint language); final double recognit...
@Test(timeout = 5000) public void testCancel() throws InterruptedException { Logger logger = mock(Logger.class); ProgressReport report = new ProgressReport(ProgressReport.class.getName(), 100, logger, "analyzed"); report.start(Arrays.asList("foo.java")); waitForMessage(logger); report.cancel(); }
public synchronized void cancel() { thread.interrupt(); join(); }
ProgressReport implements Runnable { public synchronized void cancel() { thread.interrupt(); join(); } }
ProgressReport implements Runnable { public synchronized void cancel() { thread.interrupt(); join(); } ProgressReport(String threadName, long period, Logger logger, String adjective); ProgressReport(String threadName, long period, String adjective); ProgressReport(String threadName, long period); }
ProgressReport implements Runnable { public synchronized void cancel() { thread.interrupt(); join(); } ProgressReport(String threadName, long period, Logger logger, String adjective); ProgressReport(String threadName, long period, String adjective); ProgressReport(String threadName, long period); @Override void run()...
ProgressReport implements Runnable { public synchronized void cancel() { thread.interrupt(); join(); } ProgressReport(String threadName, long period, Logger logger, String adjective); ProgressReport(String threadName, long period, String adjective); ProgressReport(String threadName, long period); @Override void run()...
@Test public void test_generation_of_profile() throws Exception { ProfileGenerator.RulesConfiguration rulesConfiguration = new ProfileGenerator.RulesConfiguration() .add("S1451", "headerFormat", " .add("S1451", "isRegularExpression", "true") .add("S2762", "threshold", "1"); Set<String> rules = new HashSet<>(Arrays.asLi...
public static File generateProfile(String serverUrl, String language, String repository, RulesConfiguration rulesConfiguration, Set<String> excludedRules) { try { Set<String> ruleKeys = getRuleKeys(serverUrl, language, repository); ruleKeys.removeAll(excludedRules); return generateProfile(language, repository, rulesCon...
ProfileGenerator { public static File generateProfile(String serverUrl, String language, String repository, RulesConfiguration rulesConfiguration, Set<String> excludedRules) { try { Set<String> ruleKeys = getRuleKeys(serverUrl, language, repository); ruleKeys.removeAll(excludedRules); return generateProfile(language, r...
ProfileGenerator { public static File generateProfile(String serverUrl, String language, String repository, RulesConfiguration rulesConfiguration, Set<String> excludedRules) { try { Set<String> ruleKeys = getRuleKeys(serverUrl, language, repository); ruleKeys.removeAll(excludedRules); return generateProfile(language, r...
ProfileGenerator { public static File generateProfile(String serverUrl, String language, String repository, RulesConfiguration rulesConfiguration, Set<String> excludedRules) { try { Set<String> ruleKeys = getRuleKeys(serverUrl, language, repository); ruleKeys.removeAll(excludedRules); return generateProfile(language, r...
ProfileGenerator { public static File generateProfile(String serverUrl, String language, String repository, RulesConfiguration rulesConfiguration, Set<String> excludedRules) { try { Set<String> ruleKeys = getRuleKeys(serverUrl, language, repository); ruleKeys.removeAll(excludedRules); return generateProfile(language, r...
@Test public void test_connection() throws Exception { ProfileGenerator.RulesConfiguration rulesConfiguration = new ProfileGenerator.RulesConfiguration(); ServerSocket mockServer = new ServerSocket(0); ExecutorService executorService = Executors.newSingleThreadExecutor(); executorService.submit(() -> { Socket socket = ...
public static File generateProfile(String serverUrl, String language, String repository, RulesConfiguration rulesConfiguration, Set<String> excludedRules) { try { Set<String> ruleKeys = getRuleKeys(serverUrl, language, repository); ruleKeys.removeAll(excludedRules); return generateProfile(language, repository, rulesCon...
ProfileGenerator { public static File generateProfile(String serverUrl, String language, String repository, RulesConfiguration rulesConfiguration, Set<String> excludedRules) { try { Set<String> ruleKeys = getRuleKeys(serverUrl, language, repository); ruleKeys.removeAll(excludedRules); return generateProfile(language, r...
ProfileGenerator { public static File generateProfile(String serverUrl, String language, String repository, RulesConfiguration rulesConfiguration, Set<String> excludedRules) { try { Set<String> ruleKeys = getRuleKeys(serverUrl, language, repository); ruleKeys.removeAll(excludedRules); return generateProfile(language, r...
ProfileGenerator { public static File generateProfile(String serverUrl, String language, String repository, RulesConfiguration rulesConfiguration, Set<String> excludedRules) { try { Set<String> ruleKeys = getRuleKeys(serverUrl, language, repository); ruleKeys.removeAll(excludedRules); return generateProfile(language, r...
ProfileGenerator { public static File generateProfile(String serverUrl, String language, String repository, RulesConfiguration rulesConfiguration, Set<String> excludedRules) { try { Set<String> ruleKeys = getRuleKeys(serverUrl, language, repository); ruleKeys.removeAll(excludedRules); return generateProfile(language, r...
@Test public void parse() throws Exception { JsonParser parser = new JsonParser(); Map<String, Object> map = parser.parse("{ \"name\" : \"Paul\" }"); Object name = map.get("name"); assertThat(name).isEqualTo("Paul"); }
Map<String, Object> parse(String data) { try { return (Map<String, Object>) parser.parse(data); } catch (ParseException e) { throw new IllegalArgumentException("Could not parse JSON", e); } }
JsonParser { Map<String, Object> parse(String data) { try { return (Map<String, Object>) parser.parse(data); } catch (ParseException e) { throw new IllegalArgumentException("Could not parse JSON", e); } } }
JsonParser { Map<String, Object> parse(String data) { try { return (Map<String, Object>) parser.parse(data); } catch (ParseException e) { throw new IllegalArgumentException("Could not parse JSON", e); } } }
JsonParser { Map<String, Object> parse(String data) { try { return (Map<String, Object>) parser.parse(data); } catch (ParseException e) { throw new IllegalArgumentException("Could not parse JSON", e); } } }
JsonParser { Map<String, Object> parse(String data) { try { return (Map<String, Object>) parser.parse(data); } catch (ParseException e) { throw new IllegalArgumentException("Could not parse JSON", e); } } }
@Test(expected = IllegalArgumentException.class) public void invalid_json() { new JsonParser().parse("{{}"); }
Map<String, Object> parse(String data) { try { return (Map<String, Object>) parser.parse(data); } catch (ParseException e) { throw new IllegalArgumentException("Could not parse JSON", e); } }
JsonParser { Map<String, Object> parse(String data) { try { return (Map<String, Object>) parser.parse(data); } catch (ParseException e) { throw new IllegalArgumentException("Could not parse JSON", e); } } }
JsonParser { Map<String, Object> parse(String data) { try { return (Map<String, Object>) parser.parse(data); } catch (ParseException e) { throw new IllegalArgumentException("Could not parse JSON", e); } } }
JsonParser { Map<String, Object> parse(String data) { try { return (Map<String, Object>) parser.parse(data); } catch (ParseException e) { throw new IllegalArgumentException("Could not parse JSON", e); } } }
JsonParser { Map<String, Object> parse(String data) { try { return (Map<String, Object>) parser.parse(data); } catch (ParseException e) { throw new IllegalArgumentException("Could not parse JSON", e); } } }
@Test public void load_profile_keys() { NewBuiltInQualityProfile newProfile = testContext.createBuiltInQualityProfile(PROFILE_NAME, LANGUAGE); BuiltInQualityProfileJsonLoader.load(newProfile, REPOSITORY_KEY, PROFILE_PATH); newProfile.done(); BuiltInQualityProfile profile = testContext.profile(LANGUAGE, PROFILE_NAME); L...
public static void load(NewBuiltInQualityProfile profile, String repositoryKey, String jsonProfilePath) { Set<String> activeKeys = loadActiveKeysFromJsonProfile(jsonProfilePath); for (String activeKey : activeKeys) { profile.activateRule(repositoryKey, activeKey); } }
BuiltInQualityProfileJsonLoader { public static void load(NewBuiltInQualityProfile profile, String repositoryKey, String jsonProfilePath) { Set<String> activeKeys = loadActiveKeysFromJsonProfile(jsonProfilePath); for (String activeKey : activeKeys) { profile.activateRule(repositoryKey, activeKey); } } }
BuiltInQualityProfileJsonLoader { public static void load(NewBuiltInQualityProfile profile, String repositoryKey, String jsonProfilePath) { Set<String> activeKeys = loadActiveKeysFromJsonProfile(jsonProfilePath); for (String activeKey : activeKeys) { profile.activateRule(repositoryKey, activeKey); } } private BuiltInQ...
BuiltInQualityProfileJsonLoader { public static void load(NewBuiltInQualityProfile profile, String repositoryKey, String jsonProfilePath) { Set<String> activeKeys = loadActiveKeysFromJsonProfile(jsonProfilePath); for (String activeKey : activeKeys) { profile.activateRule(repositoryKey, activeKey); } } private BuiltInQ...
BuiltInQualityProfileJsonLoader { public static void load(NewBuiltInQualityProfile profile, String repositoryKey, String jsonProfilePath) { Set<String> activeKeys = loadActiveKeysFromJsonProfile(jsonProfilePath); for (String activeKey : activeKeys) { profile.activateRule(repositoryKey, activeKey); } } private BuiltInQ...
@Test public void testMaxTaskVersion() { DACConfig dacConfig = DACConfig.newConfig(); Upgrade upgrade = new Upgrade(dacConfig, CLASSPATH_SCAN_RESULT, false); final Optional<Version> tasksGreatestMaxVersion = upgrade.getUpgradeTasks().stream() .filter((v) -> v instanceof LegacyUpgradeTask) .map((v) -> ((LegacyUpgradeTas...
@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 testUpdateReflection() { Reflection newReflection = createReflection(); Reflection response = expectSuccess(getBuilder(getPublicAPI(3).path(REFLECTIONS_PATH)).buildPost(Entity.entity(newReflection, JSON)), Reflection.class); String betterName = "much better name"; response.setName(betterName); Reflect...
@POST public Reflection createReflection(Reflection reflection) { ReflectionGoal newReflection = reflectionServiceHelper.createReflection(reflection.toReflectionGoal()); String id = newReflection.getId().getId(); return new Reflection(newReflection, reflectionServiceHelper.getStatusForReflection(id), reflectionServiceH...
ReflectionResource { @POST public Reflection createReflection(Reflection reflection) { ReflectionGoal newReflection = reflectionServiceHelper.createReflection(reflection.toReflectionGoal()); String id = newReflection.getId().getId(); return new Reflection(newReflection, reflectionServiceHelper.getStatusForReflection(id...
ReflectionResource { @POST public Reflection createReflection(Reflection reflection) { ReflectionGoal newReflection = reflectionServiceHelper.createReflection(reflection.toReflectionGoal()); String id = newReflection.getId().getId(); return new Reflection(newReflection, reflectionServiceHelper.getStatusForReflection(id...
ReflectionResource { @POST public Reflection createReflection(Reflection reflection) { ReflectionGoal newReflection = reflectionServiceHelper.createReflection(reflection.toReflectionGoal()); String id = newReflection.getId().getId(); return new Reflection(newReflection, reflectionServiceHelper.getStatusForReflection(id...
ReflectionResource { @POST public Reflection createReflection(Reflection reflection) { ReflectionGoal newReflection = reflectionServiceHelper.createReflection(reflection.toReflectionGoal()); String id = newReflection.getId().getId(); return new Reflection(newReflection, reflectionServiceHelper.getStatusForReflection(id...
@Test public void testBoostToggleOnRawReflection() { Reflection newReflection = createReflection(); Reflection response = expectSuccess(getBuilder(getPublicAPI(3).path(REFLECTIONS_PATH)).buildPost(Entity.entity(newReflection, JSON)), Reflection.class); assertFalse(response.isArrowCachingEnabled()); response.setArrowCac...
@POST public Reflection createReflection(Reflection reflection) { ReflectionGoal newReflection = reflectionServiceHelper.createReflection(reflection.toReflectionGoal()); String id = newReflection.getId().getId(); return new Reflection(newReflection, reflectionServiceHelper.getStatusForReflection(id), reflectionServiceH...
ReflectionResource { @POST public Reflection createReflection(Reflection reflection) { ReflectionGoal newReflection = reflectionServiceHelper.createReflection(reflection.toReflectionGoal()); String id = newReflection.getId().getId(); return new Reflection(newReflection, reflectionServiceHelper.getStatusForReflection(id...
ReflectionResource { @POST public Reflection createReflection(Reflection reflection) { ReflectionGoal newReflection = reflectionServiceHelper.createReflection(reflection.toReflectionGoal()); String id = newReflection.getId().getId(); return new Reflection(newReflection, reflectionServiceHelper.getStatusForReflection(id...
ReflectionResource { @POST public Reflection createReflection(Reflection reflection) { ReflectionGoal newReflection = reflectionServiceHelper.createReflection(reflection.toReflectionGoal()); String id = newReflection.getId().getId(); return new Reflection(newReflection, reflectionServiceHelper.getStatusForReflection(id...
ReflectionResource { @POST public Reflection createReflection(Reflection reflection) { ReflectionGoal newReflection = reflectionServiceHelper.createReflection(reflection.toReflectionGoal()); String id = newReflection.getId().getId(); return new Reflection(newReflection, reflectionServiceHelper.getStatusForReflection(id...
@Test public void testDeleteReflection() { Reflection newReflection = createReflection(); Reflection response = expectSuccess(getBuilder(getPublicAPI(3).path(REFLECTIONS_PATH)).buildPost(Entity.entity(newReflection, JSON)), Reflection.class); expectSuccess(getBuilder(getPublicAPI(3).path(REFLECTIONS_PATH).path(response...
@DELETE @Path("/{id}") public Response deleteReflection(@PathParam("id") String id) { reflectionServiceHelper.removeReflection(id); return Response.ok().build(); }
ReflectionResource { @DELETE @Path("/{id}") public Response deleteReflection(@PathParam("id") String id) { reflectionServiceHelper.removeReflection(id); return Response.ok().build(); } }
ReflectionResource { @DELETE @Path("/{id}") public Response deleteReflection(@PathParam("id") String id) { reflectionServiceHelper.removeReflection(id); return Response.ok().build(); } @Inject ReflectionResource(ReflectionServiceHelper reflectionServiceHelper, CatalogServiceHelper catalogServiceHelper); }
ReflectionResource { @DELETE @Path("/{id}") public Response deleteReflection(@PathParam("id") String id) { reflectionServiceHelper.removeReflection(id); return Response.ok().build(); } @Inject ReflectionResource(ReflectionServiceHelper reflectionServiceHelper, CatalogServiceHelper catalogServiceHelper); @GET @Path("/{...
ReflectionResource { @DELETE @Path("/{id}") public Response deleteReflection(@PathParam("id") String id) { reflectionServiceHelper.removeReflection(id); return Response.ok().build(); } @Inject ReflectionResource(ReflectionServiceHelper reflectionServiceHelper, CatalogServiceHelper catalogServiceHelper); @GET @Path("/{...
@Test public void testListSources() throws Exception { ResponseList<SourceResource.SourceDeprecated> sources = expectSuccess(getBuilder(getPublicAPI(3).path(SOURCES_PATH)).buildGet(), new GenericType<ResponseList<SourceResource.SourceDeprecated>>() {}); assertEquals(sources.getData().size(), newSourceService().getSourc...
@GET @RolesAllowed({"admin", "user"}) public ResponseList<Source> getSources() { final ResponseList<Source> sources = new ResponseList<>(); final List<SourceConfig> sourceConfigs = sourceService.getSources(); for (SourceConfig sourceConfig : sourceConfigs) { Source source = fromSourceConfig(sourceConfig); sources.add(s...
SourceResource { @GET @RolesAllowed({"admin", "user"}) public ResponseList<Source> getSources() { final ResponseList<Source> sources = new ResponseList<>(); final List<SourceConfig> sourceConfigs = sourceService.getSources(); for (SourceConfig sourceConfig : sourceConfigs) { Source source = fromSourceConfig(sourceConfi...
SourceResource { @GET @RolesAllowed({"admin", "user"}) public ResponseList<Source> getSources() { final ResponseList<Source> sources = new ResponseList<>(); final List<SourceConfig> sourceConfigs = sourceService.getSources(); for (SourceConfig sourceConfig : sourceConfigs) { Source source = fromSourceConfig(sourceConfi...
SourceResource { @GET @RolesAllowed({"admin", "user"}) public ResponseList<Source> getSources() { final ResponseList<Source> sources = new ResponseList<>(); final List<SourceConfig> sourceConfigs = sourceService.getSources(); for (SourceConfig sourceConfig : sourceConfigs) { Source source = fromSourceConfig(sourceConfi...
SourceResource { @GET @RolesAllowed({"admin", "user"}) public ResponseList<Source> getSources() { final ResponseList<Source> sources = new ResponseList<>(); final List<SourceConfig> sourceConfigs = sourceService.getSources(); for (SourceConfig sourceConfig : sourceConfigs) { Source source = fromSourceConfig(sourceConfi...
@Test public void testAddSource() throws Exception { SourceResource.SourceDeprecated newSource = new SourceResource.SourceDeprecated(); newSource.setName("Foopy"); newSource.setType("NAS"); NASConf config = new NASConf(); config.path = "/"; newSource.setConfig(config); SourceResource.SourceDeprecated source = expectSuc...
@POST @RolesAllowed({"admin"}) public SourceDeprecated addSource(SourceDeprecated source) { try { SourceConfig newSourceConfig = sourceService.createSource(source.toSourceConfig()); return fromSourceConfig(newSourceConfig); } catch (NamespaceException | ExecutionSetupException e) { throw new ServerErrorException(e); } ...
SourceResource { @POST @RolesAllowed({"admin"}) public SourceDeprecated addSource(SourceDeprecated source) { try { SourceConfig newSourceConfig = sourceService.createSource(source.toSourceConfig()); return fromSourceConfig(newSourceConfig); } catch (NamespaceException | ExecutionSetupException e) { throw new ServerErro...
SourceResource { @POST @RolesAllowed({"admin"}) public SourceDeprecated addSource(SourceDeprecated source) { try { SourceConfig newSourceConfig = sourceService.createSource(source.toSourceConfig()); return fromSourceConfig(newSourceConfig); } catch (NamespaceException | ExecutionSetupException e) { throw new ServerErro...
SourceResource { @POST @RolesAllowed({"admin"}) public SourceDeprecated addSource(SourceDeprecated source) { try { SourceConfig newSourceConfig = sourceService.createSource(source.toSourceConfig()); return fromSourceConfig(newSourceConfig); } catch (NamespaceException | ExecutionSetupException e) { throw new ServerErro...
SourceResource { @POST @RolesAllowed({"admin"}) public SourceDeprecated addSource(SourceDeprecated source) { try { SourceConfig newSourceConfig = sourceService.createSource(source.toSourceConfig()); return fromSourceConfig(newSourceConfig); } catch (NamespaceException | ExecutionSetupException e) { throw new ServerErro...
@Test public void testUpdateSource() throws Exception { SourceConfig sourceConfig = new SourceConfig(); sourceConfig.setName("Foopy2"); NASConf nasConfig = new NASConf(); sourceConfig.setType(nasConfig.getType()); nasConfig.path = "/"; sourceConfig.setConfig(nasConfig.toBytesString()); SourceConfig createdSourceConfig ...
@PUT @RolesAllowed({"admin"}) @Path("/{id}") public SourceDeprecated updateSource(@PathParam("id") String id, SourceDeprecated source) { SourceConfig sourceConfig; try { sourceConfig = sourceService.updateSource(id, source.toSourceConfig()); return fromSourceConfig(sourceConfig); } catch (NamespaceException | Execution...
SourceResource { @PUT @RolesAllowed({"admin"}) @Path("/{id}") public SourceDeprecated updateSource(@PathParam("id") String id, SourceDeprecated source) { SourceConfig sourceConfig; try { sourceConfig = sourceService.updateSource(id, source.toSourceConfig()); return fromSourceConfig(sourceConfig); } catch (NamespaceExce...
SourceResource { @PUT @RolesAllowed({"admin"}) @Path("/{id}") public SourceDeprecated updateSource(@PathParam("id") String id, SourceDeprecated source) { SourceConfig sourceConfig; try { sourceConfig = sourceService.updateSource(id, source.toSourceConfig()); return fromSourceConfig(sourceConfig); } catch (NamespaceExce...
SourceResource { @PUT @RolesAllowed({"admin"}) @Path("/{id}") public SourceDeprecated updateSource(@PathParam("id") String id, SourceDeprecated source) { SourceConfig sourceConfig; try { sourceConfig = sourceService.updateSource(id, source.toSourceConfig()); return fromSourceConfig(sourceConfig); } catch (NamespaceExce...
SourceResource { @PUT @RolesAllowed({"admin"}) @Path("/{id}") public SourceDeprecated updateSource(@PathParam("id") String id, SourceDeprecated source) { SourceConfig sourceConfig; try { sourceConfig = sourceService.updateSource(id, source.toSourceConfig()); return fromSourceConfig(sourceConfig); } catch (NamespaceExce...
@Test public void testUpdateSourceErrors() throws Exception { SourceConfig sourceConfig = new SourceConfig(); sourceConfig.setName("Foopy5"); NASConf nasConfig = new NASConf(); sourceConfig.setType(nasConfig.getType()); nasConfig.path = "/"; sourceConfig.setConfig(nasConfig.toBytesString()); SourceConfig createdSourceC...
@DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); }
SourceResource { @DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); } }
SourceResource { @DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); } @Inject SourceResource(SourceService sourceService, Sa...
SourceResource { @DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); } @Inject SourceResource(SourceService sourceService, Sa...
SourceResource { @DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); } @Inject SourceResource(SourceService sourceService, Sa...
@Test public void testUpdateSourceBoundaryValues() throws Exception { SourceConfig sourceConfig = new SourceConfig(); sourceConfig.setName("Foopy2"); NASConf nasConfig = new NASConf(); sourceConfig.setType(nasConfig.getType()); nasConfig.path = "/"; sourceConfig.setConfig(nasConfig.toBytesString()); SourceConfig create...
@DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); }
SourceResource { @DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); } }
SourceResource { @DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); } @Inject SourceResource(SourceService sourceService, Sa...
SourceResource { @DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); } @Inject SourceResource(SourceService sourceService, Sa...
SourceResource { @DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); } @Inject SourceResource(SourceService sourceService, Sa...
@Test public void testGetSource() throws Exception { SourceConfig sourceConfig = new SourceConfig(); sourceConfig.setName("Foopy4"); NASConf nasConfig = new NASConf(); sourceConfig.setType(nasConfig.getType()); nasConfig.path = "/"; sourceConfig.setConfig(nasConfig.toBytesString()); SourceConfig createdSourceConfig = n...
@GET @RolesAllowed({"admin", "user"}) @Path("/{id}") public SourceDeprecated getSource(@PathParam("id") String id) throws NamespaceException { SourceConfig sourceConfig = sourceService.getById(id); return fromSourceConfig(sourceConfig); }
SourceResource { @GET @RolesAllowed({"admin", "user"}) @Path("/{id}") public SourceDeprecated getSource(@PathParam("id") String id) throws NamespaceException { SourceConfig sourceConfig = sourceService.getById(id); return fromSourceConfig(sourceConfig); } }
SourceResource { @GET @RolesAllowed({"admin", "user"}) @Path("/{id}") public SourceDeprecated getSource(@PathParam("id") String id) throws NamespaceException { SourceConfig sourceConfig = sourceService.getById(id); return fromSourceConfig(sourceConfig); } @Inject SourceResource(SourceService sourceService, SabotContex...
SourceResource { @GET @RolesAllowed({"admin", "user"}) @Path("/{id}") public SourceDeprecated getSource(@PathParam("id") String id) throws NamespaceException { SourceConfig sourceConfig = sourceService.getById(id); return fromSourceConfig(sourceConfig); } @Inject SourceResource(SourceService sourceService, SabotContex...
SourceResource { @GET @RolesAllowed({"admin", "user"}) @Path("/{id}") public SourceDeprecated getSource(@PathParam("id") String id) throws NamespaceException { SourceConfig sourceConfig = sourceService.getById(id); return fromSourceConfig(sourceConfig); } @Inject SourceResource(SourceService sourceService, SabotContex...
@Test public void testDeleteSource() throws Exception { SourceConfig sourceConfig = new SourceConfig(); sourceConfig.setName("Foopy3"); NASConf nasConfig = new NASConf(); sourceConfig.setType(nasConfig.getType()); nasConfig.path = "/"; sourceConfig.setConfig(nasConfig.toBytesString()); SourceConfig createdSourceConfig ...
@DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); }
SourceResource { @DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); } }
SourceResource { @DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); } @Inject SourceResource(SourceService sourceService, Sa...
SourceResource { @DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); } @Inject SourceResource(SourceService sourceService, Sa...
SourceResource { @DELETE @RolesAllowed("admin") @Path("/{id}") public Response deleteSource(@PathParam("id") String id) throws NamespaceException { SourceConfig config = sourceService.getById(id); sourceService.deleteSource(config); return Response.ok().build(); } @Inject SourceResource(SourceService sourceService, Sa...
@Test public void testPost460Version() throws Exception { final Version version = new Version("4.6.1", 4, 6, 1, 0, ""); assertFalse(SetTableauDefaults.updateOptionsIfNeeded(version, () -> optionManager, true)); }
@VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; } final SystemOptionManager optionManager...
SetTableauDefaults extends UpgradeTask { @VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; ...
SetTableauDefaults extends UpgradeTask { @VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; ...
SetTableauDefaults extends UpgradeTask { @VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; ...
SetTableauDefaults extends UpgradeTask { @VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; ...
@Test public void testRemovingSensitiveFields() throws Exception { SourceConfig config = new SourceConfig(); config.setName("Foopy"); config.setId(new EntityId("id")); config.setTag("0"); config.setAccelerationGracePeriod(0L); config.setAccelerationRefreshPeriod(0L); APrivateSource priv = new APrivateSource(); priv.pas...
@VisibleForTesting protected SourceDeprecated fromSourceConfig(SourceConfig sourceConfig) { return new SourceDeprecated(sourceService.fromSourceConfig(sourceConfig)); }
SourceResource { @VisibleForTesting protected SourceDeprecated fromSourceConfig(SourceConfig sourceConfig) { return new SourceDeprecated(sourceService.fromSourceConfig(sourceConfig)); } }
SourceResource { @VisibleForTesting protected SourceDeprecated fromSourceConfig(SourceConfig sourceConfig) { return new SourceDeprecated(sourceService.fromSourceConfig(sourceConfig)); } @Inject SourceResource(SourceService sourceService, SabotContext sabotContext); }
SourceResource { @VisibleForTesting protected SourceDeprecated fromSourceConfig(SourceConfig sourceConfig) { return new SourceDeprecated(sourceService.fromSourceConfig(sourceConfig)); } @Inject SourceResource(SourceService sourceService, SabotContext sabotContext); @GET @RolesAllowed({"admin", "user"}) ResponseList<So...
SourceResource { @VisibleForTesting protected SourceDeprecated fromSourceConfig(SourceConfig sourceConfig) { return new SourceDeprecated(sourceService.fromSourceConfig(sourceConfig)); } @Inject SourceResource(SourceService sourceService, SabotContext sabotContext); @GET @RolesAllowed({"admin", "user"}) ResponseList<So...
@Test public void testCancelJob() throws InterruptedException { JobsService jobs = l(JobsService.class); SqlQuery query = new SqlQuery("select * from sys.version", Collections.emptyList(), SystemUser.SYSTEM_USERNAME); final String id = submitAndWaitUntilSubmitted( JobRequest.newBuilder() .setSqlQuery(query) .setQueryTy...
@POST @Path("/{id}/cancel") public void cancelJob(@PathParam("id") String id) throws JobException { final String username = securityContext.getUserPrincipal().getName(); try { jobs.cancel(CancelJobRequest.newBuilder() .setUsername(username) .setJobId(JobsProtoUtil.toBuf(new JobId(id))) .setReason(String.format("Query c...
JobResource extends BaseResourceWithAllocator { @POST @Path("/{id}/cancel") public void cancelJob(@PathParam("id") String id) throws JobException { final String username = securityContext.getUserPrincipal().getName(); try { jobs.cancel(CancelJobRequest.newBuilder() .setUsername(username) .setJobId(JobsProtoUtil.toBuf(n...
JobResource extends BaseResourceWithAllocator { @POST @Path("/{id}/cancel") public void cancelJob(@PathParam("id") String id) throws JobException { final String username = securityContext.getUserPrincipal().getName(); try { jobs.cancel(CancelJobRequest.newBuilder() .setUsername(username) .setJobId(JobsProtoUtil.toBuf(n...
JobResource extends BaseResourceWithAllocator { @POST @Path("/{id}/cancel") public void cancelJob(@PathParam("id") String id) throws JobException { final String username = securityContext.getUserPrincipal().getName(); try { jobs.cancel(CancelJobRequest.newBuilder() .setUsername(username) .setJobId(JobsProtoUtil.toBuf(n...
JobResource extends BaseResourceWithAllocator { @POST @Path("/{id}/cancel") public void cancelJob(@PathParam("id") String id) throws JobException { final String username = securityContext.getUserPrincipal().getName(); try { jobs.cancel(CancelJobRequest.newBuilder() .setUsername(username) .setJobId(JobsProtoUtil.toBuf(n...
@Test public void testActiveUserStats() { EditionProvider editionProvider = mock(EditionProvider.class); when(editionProvider.getEdition()).thenReturn("oss-test"); LocalDate now = LocalDate.now(); List<JobSummary> testJobResults = new ArrayList<>(); testJobResults.add(newJob("testuser1", QueryType.ODBC, now)); testJobR...
@GET public UserStats getActiveUserStats() { try { final UserStats.Builder activeUserStats = new UserStats.Builder(); activeUserStats.setEdition(editionProvider.getEdition()); final SearchJobsRequest request = SearchJobsRequest.newBuilder() .setFilterString(String.format(FILTER, getStartOfLastMonth(), System.currentTim...
UserStatsResource { @GET public UserStats getActiveUserStats() { try { final UserStats.Builder activeUserStats = new UserStats.Builder(); activeUserStats.setEdition(editionProvider.getEdition()); final SearchJobsRequest request = SearchJobsRequest.newBuilder() .setFilterString(String.format(FILTER, getStartOfLastMonth(...
UserStatsResource { @GET public UserStats getActiveUserStats() { try { final UserStats.Builder activeUserStats = new UserStats.Builder(); activeUserStats.setEdition(editionProvider.getEdition()); final SearchJobsRequest request = SearchJobsRequest.newBuilder() .setFilterString(String.format(FILTER, getStartOfLastMonth(...
UserStatsResource { @GET public UserStats getActiveUserStats() { try { final UserStats.Builder activeUserStats = new UserStats.Builder(); activeUserStats.setEdition(editionProvider.getEdition()); final SearchJobsRequest request = SearchJobsRequest.newBuilder() .setFilterString(String.format(FILTER, getStartOfLastMonth(...
UserStatsResource { @GET public UserStats getActiveUserStats() { try { final UserStats.Builder activeUserStats = new UserStats.Builder(); activeUserStats.setEdition(editionProvider.getEdition()); final SearchJobsRequest request = SearchJobsRequest.newBuilder() .setFilterString(String.format(FILTER, getStartOfLastMonth(...
@Test public void testListSources() throws Exception { ClusterStatsResource.ClusterStats stats = expectSuccess(getBuilder(getPublicAPI(3).path(PATH)).buildGet(), ClusterStatsResource.ClusterStats.class); assertNotNull(stats); assertEquals(stats.getSources().size(), newSourceService().getSources().size()); }
@VisibleForTesting public static Stats getSources(List<SourceConfig> allSources, SabotContext context){ final Stats resource = new Stats(); for (SourceConfig sourceConfig : allSources) { int pdsCount = -1; String type = sourceConfig.getType(); if(type == null && sourceConfig.getLegacySourceTypeEnum() != null) { type = ...
ClusterStatsResource { @VisibleForTesting public static Stats getSources(List<SourceConfig> allSources, SabotContext context){ final Stats resource = new Stats(); for (SourceConfig sourceConfig : allSources) { int pdsCount = -1; String type = sourceConfig.getType(); if(type == null && sourceConfig.getLegacySourceTypeEn...
ClusterStatsResource { @VisibleForTesting public static Stats getSources(List<SourceConfig> allSources, SabotContext context){ final Stats resource = new Stats(); for (SourceConfig sourceConfig : allSources) { int pdsCount = -1; String type = sourceConfig.getType(); if(type == null && sourceConfig.getLegacySourceTypeEn...
ClusterStatsResource { @VisibleForTesting public static Stats getSources(List<SourceConfig> allSources, SabotContext context){ final Stats resource = new Stats(); for (SourceConfig sourceConfig : allSources) { int pdsCount = -1; String type = sourceConfig.getType(); if(type == null && sourceConfig.getLegacySourceTypeEn...
ClusterStatsResource { @VisibleForTesting public static Stats getSources(List<SourceConfig> allSources, SabotContext context){ final Stats resource = new Stats(); for (SourceConfig sourceConfig : allSources) { int pdsCount = -1; String type = sourceConfig.getType(); if(type == null && sourceConfig.getLegacySourceTypeEn...
@Test public void testSamplesS3() throws Exception{ List<SourceConfig> sources = new ArrayList(); SourceConfig configS3Samples = new SourceConfig(); configS3Samples.setMetadataPolicy(DEFAULT_METADATA_POLICY_WITH_AUTO_PROMOTE); configS3Samples.setName("Samples"); configS3Samples.setType("S3"); SourceConfig configS3 = ne...
@VisibleForTesting public static Stats getSources(List<SourceConfig> allSources, SabotContext context){ final Stats resource = new Stats(); for (SourceConfig sourceConfig : allSources) { int pdsCount = -1; String type = sourceConfig.getType(); if(type == null && sourceConfig.getLegacySourceTypeEnum() != null) { type = ...
ClusterStatsResource { @VisibleForTesting public static Stats getSources(List<SourceConfig> allSources, SabotContext context){ final Stats resource = new Stats(); for (SourceConfig sourceConfig : allSources) { int pdsCount = -1; String type = sourceConfig.getType(); if(type == null && sourceConfig.getLegacySourceTypeEn...
ClusterStatsResource { @VisibleForTesting public static Stats getSources(List<SourceConfig> allSources, SabotContext context){ final Stats resource = new Stats(); for (SourceConfig sourceConfig : allSources) { int pdsCount = -1; String type = sourceConfig.getType(); if(type == null && sourceConfig.getLegacySourceTypeEn...
ClusterStatsResource { @VisibleForTesting public static Stats getSources(List<SourceConfig> allSources, SabotContext context){ final Stats resource = new Stats(); for (SourceConfig sourceConfig : allSources) { int pdsCount = -1; String type = sourceConfig.getType(); if(type == null && sourceConfig.getLegacySourceTypeEn...
ClusterStatsResource { @VisibleForTesting public static Stats getSources(List<SourceConfig> allSources, SabotContext context){ final Stats resource = new Stats(); for (SourceConfig sourceConfig : allSources) { int pdsCount = -1; String type = sourceConfig.getType(); if(type == null && sourceConfig.getLegacySourceTypeEn...
@Test public void testListTopLevelCatalog() throws Exception { int topLevelCount = newSourceService().getSources().size() + newNamespaceService().getSpaces().size() + 1; ResponseList<CatalogItem> items = getRootEntities(null); assertEquals(items.getData().size(), topLevelCount); int homeCount = 0; int spaceCount = 0; i...
@GET public ResponseList<? extends CatalogItem> listTopLevelCatalog(@QueryParam("include") final List<String> include) { return new ResponseList<>(catalogServiceHelper.getTopLevelCatalogItems(include)); }
CatalogResource { @GET public ResponseList<? extends CatalogItem> listTopLevelCatalog(@QueryParam("include") final List<String> include) { return new ResponseList<>(catalogServiceHelper.getTopLevelCatalogItems(include)); } }
CatalogResource { @GET public ResponseList<? extends CatalogItem> listTopLevelCatalog(@QueryParam("include") final List<String> include) { return new ResponseList<>(catalogServiceHelper.getTopLevelCatalogItems(include)); } @Inject CatalogResource(CatalogServiceHelper catalogServiceHelper); }
CatalogResource { @GET public ResponseList<? extends CatalogItem> listTopLevelCatalog(@QueryParam("include") final List<String> include) { return new ResponseList<>(catalogServiceHelper.getTopLevelCatalogItems(include)); } @Inject CatalogResource(CatalogServiceHelper catalogServiceHelper); @GET ResponseList<? extends ...
CatalogResource { @GET public ResponseList<? extends CatalogItem> listTopLevelCatalog(@QueryParam("include") final List<String> include) { return new ResponseList<>(catalogServiceHelper.getTopLevelCatalogItems(include)); } @Inject CatalogResource(CatalogServiceHelper catalogServiceHelper); @GET ResponseList<? extends ...
@Test public void testGetUserById() throws Exception { final UserService userService = l(UserService.class); com.dremio.service.users.User user1 = userService.getUser("user1"); User user = expectSuccess(getBuilder(getPublicAPI(3).path(USER_PATH).path(user1.getUID().getId())).buildGet(), User.class); assertEquals(user.g...
@GET @Path("/{id}") public User getUser(@PathParam("id") String id) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(new UID(id))); }
UserResource { @GET @Path("/{id}") public User getUser(@PathParam("id") String id) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(new UID(id))); } }
UserResource { @GET @Path("/{id}") public User getUser(@PathParam("id") String id) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(new UID(id))); } @Inject UserResource(UserService userGroupService, NamespaceService namespaceService, @Context SecurityContext securityContext); }
UserResource { @GET @Path("/{id}") public User getUser(@PathParam("id") String id) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(new UID(id))); } @Inject UserResource(UserService userGroupService, NamespaceService namespaceService, @Context SecurityContext securityContext); @GET ...
UserResource { @GET @Path("/{id}") public User getUser(@PathParam("id") String id) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(new UID(id))); } @Inject UserResource(UserService userGroupService, NamespaceService namespaceService, @Context SecurityContext securityContext); @GET ...
@Test public void testGetUserDetails() throws Exception { final UserService userService = l(UserService.class); com.dremio.service.users.User user1 = userService.getUser("user1"); User user = expectSuccess(getBuilder(getPublicAPI(3).path(USER_PATH).path(user1.getUID().getId())) .buildGet(), User.class); assertEquals(us...
@GET @Path("/{id}") public User getUser(@PathParam("id") String id) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(new UID(id))); }
UserResource { @GET @Path("/{id}") public User getUser(@PathParam("id") String id) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(new UID(id))); } }
UserResource { @GET @Path("/{id}") public User getUser(@PathParam("id") String id) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(new UID(id))); } @Inject UserResource(UserService userGroupService, NamespaceService namespaceService, @Context SecurityContext securityContext); }
UserResource { @GET @Path("/{id}") public User getUser(@PathParam("id") String id) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(new UID(id))); } @Inject UserResource(UserService userGroupService, NamespaceService namespaceService, @Context SecurityContext securityContext); @GET ...
UserResource { @GET @Path("/{id}") public User getUser(@PathParam("id") String id) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(new UID(id))); } @Inject UserResource(UserService userGroupService, NamespaceService namespaceService, @Context SecurityContext securityContext); @GET ...
@Test public void testCreateUser() throws Exception { UserInfoRequest userInfo = new UserInfoRequest(null, "test_new_user", "test", "new user", "[email protected]", "0", "123some_password", null); User savedUser = expectSuccess(getBuilder(getPublicAPI(3).path(USER_PATH)) .buildPost(Entity.json(userInfo)), User.class); assert...
@RolesAllowed({"admin"}) @POST public User createUser(User user) throws IOException { final com.dremio.service.users.User userConfig = UserResource.addUser(of(user, Optional.empty()), user.getPassword(), userGroupService, namespaceService); return User.fromUser(userConfig); }
UserResource { @RolesAllowed({"admin"}) @POST public User createUser(User user) throws IOException { final com.dremio.service.users.User userConfig = UserResource.addUser(of(user, Optional.empty()), user.getPassword(), userGroupService, namespaceService); return User.fromUser(userConfig); } }
UserResource { @RolesAllowed({"admin"}) @POST public User createUser(User user) throws IOException { final com.dremio.service.users.User userConfig = UserResource.addUser(of(user, Optional.empty()), user.getPassword(), userGroupService, namespaceService); return User.fromUser(userConfig); } @Inject UserResource(UserSe...
UserResource { @RolesAllowed({"admin"}) @POST public User createUser(User user) throws IOException { final com.dremio.service.users.User userConfig = UserResource.addUser(of(user, Optional.empty()), user.getPassword(), userGroupService, namespaceService); return User.fromUser(userConfig); } @Inject UserResource(UserSe...
UserResource { @RolesAllowed({"admin"}) @POST public User createUser(User user) throws IOException { final com.dremio.service.users.User userConfig = UserResource.addUser(of(user, Optional.empty()), user.getPassword(), userGroupService, namespaceService); return User.fromUser(userConfig); } @Inject UserResource(UserSe...
@Test public void testUpdateUser() { UserInfoRequest userInfo = new UserInfoRequest(createdUser.getUID().getId(), createdUser.getUserName(), "a new firstName", " a new last name", "[email protected]", createdUser.getVersion(), null, null); User savedUser = expectSuccess(getBuilder(getPublicAPI(3).path(USER_PATH).path(...
@RolesAllowed({"admin", "user"}) @PUT @Path("/{id}") public User updateUser(User user, @PathParam("id") String id) throws UserNotFoundException, IOException, DACUnauthorizedException { if (Strings.isNullOrEmpty(id)) { throw new IllegalArgumentException("No user id provided"); } final com.dremio.service.users.User saved...
UserResource { @RolesAllowed({"admin", "user"}) @PUT @Path("/{id}") public User updateUser(User user, @PathParam("id") String id) throws UserNotFoundException, IOException, DACUnauthorizedException { if (Strings.isNullOrEmpty(id)) { throw new IllegalArgumentException("No user id provided"); } final com.dremio.service.u...
UserResource { @RolesAllowed({"admin", "user"}) @PUT @Path("/{id}") public User updateUser(User user, @PathParam("id") String id) throws UserNotFoundException, IOException, DACUnauthorizedException { if (Strings.isNullOrEmpty(id)) { throw new IllegalArgumentException("No user id provided"); } final com.dremio.service.u...
UserResource { @RolesAllowed({"admin", "user"}) @PUT @Path("/{id}") public User updateUser(User user, @PathParam("id") String id) throws UserNotFoundException, IOException, DACUnauthorizedException { if (Strings.isNullOrEmpty(id)) { throw new IllegalArgumentException("No user id provided"); } final com.dremio.service.u...
UserResource { @RolesAllowed({"admin", "user"}) @PUT @Path("/{id}") public User updateUser(User user, @PathParam("id") String id) throws UserNotFoundException, IOException, DACUnauthorizedException { if (Strings.isNullOrEmpty(id)) { throw new IllegalArgumentException("No user id provided"); } final com.dremio.service.u...
@Test public void testPost4x0Version() throws Exception { final Version version = new Version("5.2.0", 5, 2, 0, 0, ""); assertFalse(SetTableauDefaults.updateOptionsIfNeeded(version, () -> optionManager, true)); }
@VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; } final SystemOptionManager optionManager...
SetTableauDefaults extends UpgradeTask { @VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; ...
SetTableauDefaults extends UpgradeTask { @VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; ...
SetTableauDefaults extends UpgradeTask { @VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; ...
SetTableauDefaults extends UpgradeTask { @VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; ...
@Test public void testGetUserByName() throws Exception { final UserService userService = l(UserService.class); User user = expectSuccess(getBuilder(getPublicAPI(3).path(USER_PATH).path("by-name").path(createdUser.getUserName())).buildGet(), User.class); assertEquals(user.getId(), createdUser.getUID().getId()); assertEq...
@GET @Path("/by-name/{name}") public User getUserByName(@PathParam("name") String name) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(name)); }
UserResource { @GET @Path("/by-name/{name}") public User getUserByName(@PathParam("name") String name) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(name)); } }
UserResource { @GET @Path("/by-name/{name}") public User getUserByName(@PathParam("name") String name) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(name)); } @Inject UserResource(UserService userGroupService, NamespaceService namespaceService, @Context SecurityContext securityCo...
UserResource { @GET @Path("/by-name/{name}") public User getUserByName(@PathParam("name") String name) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(name)); } @Inject UserResource(UserService userGroupService, NamespaceService namespaceService, @Context SecurityContext securityCo...
UserResource { @GET @Path("/by-name/{name}") public User getUserByName(@PathParam("name") String name) throws UserNotFoundException { return User.fromUser(userGroupService.getUser(name)); } @Inject UserResource(UserService userGroupService, NamespaceService namespaceService, @Context SecurityContext securityCo...
@Test public void testGetEdition() { UserStats.Builder stats = new UserStats.Builder(); stats.setEdition("oss"); String expected = "dremio-oss-" + DremioVersionInfo.getVersion(); assertEquals(expected, stats.build().getEdition()); }
public String getEdition() { return edition; }
UserStats { public String getEdition() { return edition; } }
UserStats { public String getEdition() { return edition; } }
UserStats { public String getEdition() { return edition; } String getEdition(); List<Map<String, Object>> getUserStatsByDate(); List<Map<String, Object>> getUserStatsByWeek(); List<Map<String, Object>> getUserStatsByMonth(); }
UserStats { public String getEdition() { return edition; } String getEdition(); List<Map<String, Object>> getUserStatsByDate(); List<Map<String, Object>> getUserStatsByWeek(); List<Map<String, Object>> getUserStatsByMonth(); }
@Test public void testGetStatsByDate() { UserStats.Builder statsBuilder = new UserStats.Builder(); LocalDate now = LocalDate.now(); statsBuilder.addUserStat(toEpochMillis(now.minusDays(11)), "UI", "testuser1"); statsBuilder.addUserStat(toEpochMillis(now.minusDays(9)), "UI", "testuser1"); statsBuilder.addUserStat(toEpoc...
public List<Map<String, Object>> getUserStatsByDate() { return userStatsByDate; }
UserStats { public List<Map<String, Object>> getUserStatsByDate() { return userStatsByDate; } }
UserStats { public List<Map<String, Object>> getUserStatsByDate() { return userStatsByDate; } }
UserStats { public List<Map<String, Object>> getUserStatsByDate() { return userStatsByDate; } String getEdition(); List<Map<String, Object>> getUserStatsByDate(); List<Map<String, Object>> getUserStatsByWeek(); List<Map<String, Object>> getUserStatsByMonth(); }
UserStats { public List<Map<String, Object>> getUserStatsByDate() { return userStatsByDate; } String getEdition(); List<Map<String, Object>> getUserStatsByDate(); List<Map<String, Object>> getUserStatsByWeek(); List<Map<String, Object>> getUserStatsByMonth(); }
@Test public void testGetStatsByWeek() { UserStats.Builder statsBuilder = new UserStats.Builder(); LocalDate now = LocalDate.now(); statsBuilder.addUserStat(toEpochMillis(now.minusWeeks(3)), "UI", "testuser1"); statsBuilder.addUserStat(toEpochMillis(now.minusWeeks(1)), "UI", "testuser1"); statsBuilder.addUserStat(toEpo...
public List<Map<String, Object>> getUserStatsByWeek() { return userStatsByWeek; }
UserStats { public List<Map<String, Object>> getUserStatsByWeek() { return userStatsByWeek; } }
UserStats { public List<Map<String, Object>> getUserStatsByWeek() { return userStatsByWeek; } }
UserStats { public List<Map<String, Object>> getUserStatsByWeek() { return userStatsByWeek; } String getEdition(); List<Map<String, Object>> getUserStatsByDate(); List<Map<String, Object>> getUserStatsByWeek(); List<Map<String, Object>> getUserStatsByMonth(); }
UserStats { public List<Map<String, Object>> getUserStatsByWeek() { return userStatsByWeek; } String getEdition(); List<Map<String, Object>> getUserStatsByDate(); List<Map<String, Object>> getUserStatsByWeek(); List<Map<String, Object>> getUserStatsByMonth(); }
@Test public void testGetStatsByMonth() { UserStats.Builder statsBuilder = new UserStats.Builder(); LocalDate now = LocalDate.now(); statsBuilder.addUserStat(toEpochMillis(now.minusMonths(1)), "UI", "testuser1"); statsBuilder.addUserStat(toEpochMillis(now.minusMonths(1)), "UI", "testuser1"); statsBuilder.addUserStat(to...
public List<Map<String, Object>> getUserStatsByMonth() { return userStatsByMonth; }
UserStats { public List<Map<String, Object>> getUserStatsByMonth() { return userStatsByMonth; } }
UserStats { public List<Map<String, Object>> getUserStatsByMonth() { return userStatsByMonth; } }
UserStats { public List<Map<String, Object>> getUserStatsByMonth() { return userStatsByMonth; } String getEdition(); List<Map<String, Object>> getUserStatsByDate(); List<Map<String, Object>> getUserStatsByWeek(); List<Map<String, Object>> getUserStatsByMonth(); }
UserStats { public List<Map<String, Object>> getUserStatsByMonth() { return userStatsByMonth; } String getEdition(); List<Map<String, Object>> getUserStatsByDate(); List<Map<String, Object>> getUserStatsByWeek(); List<Map<String, Object>> getUserStatsByMonth(); }
@Test public void testHeaderChange() throws IOException { MediaTypeFilter filter = new MediaTypeFilter(); ContainerRequest request = ContainerRequestBuilder.from("http: filter.filter(request); assertEquals(1, request.getAcceptableMediaTypes().size()); assertEquals(new AcceptableMediaType("unit", "test"), request.getAcc...
@Override public void filter(ContainerRequestContext requestContext) throws IOException { final UriInfo info = requestContext.getUriInfo(); MultivaluedMap<String, String> parameters = info.getQueryParameters(); String format = parameters.getFirst("format"); if (format == null) { return; } requestContext.getHeaders().pu...
MediaTypeFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { final UriInfo info = requestContext.getUriInfo(); MultivaluedMap<String, String> parameters = info.getQueryParameters(); String format = parameters.getFirst("format"); if (format...
MediaTypeFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { final UriInfo info = requestContext.getUriInfo(); MultivaluedMap<String, String> parameters = info.getQueryParameters(); String format = parameters.getFirst("format"); if (format...
MediaTypeFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { final UriInfo info = requestContext.getUriInfo(); MultivaluedMap<String, String> parameters = info.getQueryParameters(); String format = parameters.getFirst("format"); if (format...
MediaTypeFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { final UriInfo info = requestContext.getUriInfo(); MultivaluedMap<String, String> parameters = info.getQueryParameters(); String format = parameters.getFirst("format"); if (format...
@Test public void testHeaderIsUntouched() throws IOException { MediaTypeFilter filter = new MediaTypeFilter(); ContainerRequest request = ContainerRequestBuilder.from("http: filter.filter(request); assertEquals(1, request.getAcceptableMediaTypes().size()); assertEquals(new AcceptableMediaType("random", "media"), reques...
@Override public void filter(ContainerRequestContext requestContext) throws IOException { final UriInfo info = requestContext.getUriInfo(); MultivaluedMap<String, String> parameters = info.getQueryParameters(); String format = parameters.getFirst("format"); if (format == null) { return; } requestContext.getHeaders().pu...
MediaTypeFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { final UriInfo info = requestContext.getUriInfo(); MultivaluedMap<String, String> parameters = info.getQueryParameters(); String format = parameters.getFirst("format"); if (format...
MediaTypeFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { final UriInfo info = requestContext.getUriInfo(); MultivaluedMap<String, String> parameters = info.getQueryParameters(); String format = parameters.getFirst("format"); if (format...
MediaTypeFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { final UriInfo info = requestContext.getUriInfo(); MultivaluedMap<String, String> parameters = info.getQueryParameters(); String format = parameters.getFirst("format"); if (format...
MediaTypeFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { final UriInfo info = requestContext.getUriInfo(); MultivaluedMap<String, String> parameters = info.getQueryParameters(); String format = parameters.getFirst("format"); if (format...
@Test public void testIsHealthy() { assertTrue(classpathHealthMonitor.isHealthy()); new File(secondJarFolder).setExecutable(false); assertFalse(classpathHealthMonitor.isHealthy()); new File(secondJarFolder).setExecutable(true); assertTrue(classpathHealthMonitor.isHealthy()); new File(secondJarFolder).delete(); assertFa...
@Override public boolean isHealthy() { logger.debug("Checking jars {}", necessaryJarFoldersSet.size()); for(String jarFolderPath : necessaryJarFoldersSet) { File jarFolder = new File(jarFolderPath); boolean folderAccessible = false; try { folderAccessible = Files.isExecutable(jarFolder.toPath()); } catch (SecurityExcep...
ClasspathHealthMonitor implements LiveHealthMonitor { @Override public boolean isHealthy() { logger.debug("Checking jars {}", necessaryJarFoldersSet.size()); for(String jarFolderPath : necessaryJarFoldersSet) { File jarFolder = new File(jarFolderPath); boolean folderAccessible = false; try { folderAccessible = Files.is...
ClasspathHealthMonitor implements LiveHealthMonitor { @Override public boolean isHealthy() { logger.debug("Checking jars {}", necessaryJarFoldersSet.size()); for(String jarFolderPath : necessaryJarFoldersSet) { File jarFolder = new File(jarFolderPath); boolean folderAccessible = false; try { folderAccessible = Files.is...
ClasspathHealthMonitor implements LiveHealthMonitor { @Override public boolean isHealthy() { logger.debug("Checking jars {}", necessaryJarFoldersSet.size()); for(String jarFolderPath : necessaryJarFoldersSet) { File jarFolder = new File(jarFolderPath); boolean folderAccessible = false; try { folderAccessible = Files.is...
ClasspathHealthMonitor implements LiveHealthMonitor { @Override public boolean isHealthy() { logger.debug("Checking jars {}", necessaryJarFoldersSet.size()); for(String jarFolderPath : necessaryJarFoldersSet) { File jarFolder = new File(jarFolderPath); boolean folderAccessible = false; try { folderAccessible = Files.is...
@Test public void testJSONGeneratorUntouched() throws IOException { JSONJobDataFilter filter = new JSONJobDataFilter(); ContainerRequestBuilder request = ContainerRequestBuilder.from("http: if (testData.getHeaderKey() != null) { request.header(testData.getHeaderKey(), testData.getHeaderValue()); } ContainerResponse res...
@Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { if (!APPLICATION_JSON_TYPE.equals(responseContext.getMediaType()) || !WebServer.X_DREMIO_JOB_DATA_NUMBERS_AS_STRINGS_SUPPORTED_VALUE .equals(requestContext.getHeaderString(WebServer.X_DREM...
JSONJobDataFilter implements ContainerResponseFilter { @Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { if (!APPLICATION_JSON_TYPE.equals(responseContext.getMediaType()) || !WebServer.X_DREMIO_JOB_DATA_NUMBERS_AS_STRINGS_SUPPORTED_VALUE ...
JSONJobDataFilter implements ContainerResponseFilter { @Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { if (!APPLICATION_JSON_TYPE.equals(responseContext.getMediaType()) || !WebServer.X_DREMIO_JOB_DATA_NUMBERS_AS_STRINGS_SUPPORTED_VALUE ...
JSONJobDataFilter implements ContainerResponseFilter { @Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { if (!APPLICATION_JSON_TYPE.equals(responseContext.getMediaType()) || !WebServer.X_DREMIO_JOB_DATA_NUMBERS_AS_STRINGS_SUPPORTED_VALUE ...
JSONJobDataFilter implements ContainerResponseFilter { @Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { if (!APPLICATION_JSON_TYPE.equals(responseContext.getMediaType()) || !WebServer.X_DREMIO_JOB_DATA_NUMBERS_AS_STRINGS_SUPPORTED_VALUE ...
@Test public void testJSONGeneratorConfigured() throws IOException { JSONPrettyPrintFilter filter = new JSONPrettyPrintFilter(); ContainerRequest request = ContainerRequestBuilder.from("http: ContainerResponse response = new ContainerResponse(request, Response.ok().build()); filter.filter(request, response); ObjectWrit...
@Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { UriInfo info = requestContext.getUriInfo(); if (!info.getQueryParameters().containsKey("pretty")) { return; } ObjectWriterInjector.set(new PrettyPrintWriter(ObjectWriterInjector.getAndClea...
JSONPrettyPrintFilter implements ContainerResponseFilter { @Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { UriInfo info = requestContext.getUriInfo(); if (!info.getQueryParameters().containsKey("pretty")) { return; } ObjectWriterInjecto...
JSONPrettyPrintFilter implements ContainerResponseFilter { @Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { UriInfo info = requestContext.getUriInfo(); if (!info.getQueryParameters().containsKey("pretty")) { return; } ObjectWriterInjecto...
JSONPrettyPrintFilter implements ContainerResponseFilter { @Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { UriInfo info = requestContext.getUriInfo(); if (!info.getQueryParameters().containsKey("pretty")) { return; } ObjectWriterInjecto...
JSONPrettyPrintFilter implements ContainerResponseFilter { @Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { UriInfo info = requestContext.getUriInfo(); if (!info.getQueryParameters().containsKey("pretty")) { return; } ObjectWriterInjecto...
@Test public void testPre460VersionAndKeyExists() throws Exception { final Version version = new Version("5.1.0", 5, 2, 0, 0, ""); assertFalse(SetTableauDefaults.updateOptionsIfNeeded(version, () -> optionManager, true)); assertFalse(optionManager.isSet(TableauResource.CLIENT_TOOLS_TABLEAU.getOptionName())); }
@VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; } final SystemOptionManager optionManager...
SetTableauDefaults extends UpgradeTask { @VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; ...
SetTableauDefaults extends UpgradeTask { @VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; ...
SetTableauDefaults extends UpgradeTask { @VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; ...
SetTableauDefaults extends UpgradeTask { @VisibleForTesting static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier, boolean isOptionManagerOpen) throws Exception { if (Upgrade.UPGRADE_VERSION_ORDERING.compare(previousVersion, VERSION_460) >= 0) { return false; ...
@Test public void testJSONGeneratorUntouched() throws IOException { JSONPrettyPrintFilter filter = new JSONPrettyPrintFilter(); ContainerRequest request = ContainerRequestBuilder.from("http: ContainerResponse response = new ContainerResponse(request, Response.ok().build()); filter.filter(request, response); ObjectWrite...
@Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { UriInfo info = requestContext.getUriInfo(); if (!info.getQueryParameters().containsKey("pretty")) { return; } ObjectWriterInjector.set(new PrettyPrintWriter(ObjectWriterInjector.getAndClea...
JSONPrettyPrintFilter implements ContainerResponseFilter { @Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { UriInfo info = requestContext.getUriInfo(); if (!info.getQueryParameters().containsKey("pretty")) { return; } ObjectWriterInjecto...
JSONPrettyPrintFilter implements ContainerResponseFilter { @Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { UriInfo info = requestContext.getUriInfo(); if (!info.getQueryParameters().containsKey("pretty")) { return; } ObjectWriterInjecto...
JSONPrettyPrintFilter implements ContainerResponseFilter { @Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { UriInfo info = requestContext.getUriInfo(); if (!info.getQueryParameters().containsKey("pretty")) { return; } ObjectWriterInjecto...
JSONPrettyPrintFilter implements ContainerResponseFilter { @Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { UriInfo info = requestContext.getUriInfo(); if (!info.getQueryParameters().containsKey("pretty")) { return; } ObjectWriterInjecto...
@Test public void test() throws Exception { Doc docv2 = new Doc(asList(DatasetVersionResource.class)); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); docv2.generateDoc("V2", out); assertTrue(baos.toString(), baos.toString().contains(DatasetVersionResource.class.getNam...
void generateDoc(String linkPrefix, PrintStream out) throws JsonMappingException, JsonProcessingException { Set<Class<?>> classes = new TreeSet<>(new Comparator<Class<?>>() { @Override public int compare(Class<?> o1, Class<?> o2) { return o1.getName().compareTo(o2.getName()); } }); classes.addAll(this.classes); for (Cl...
Doc { void generateDoc(String linkPrefix, PrintStream out) throws JsonMappingException, JsonProcessingException { Set<Class<?>> classes = new TreeSet<>(new Comparator<Class<?>>() { @Override public int compare(Class<?> o1, Class<?> o2) { return o1.getName().compareTo(o2.getName()); } }); classes.addAll(this.classes); f...
Doc { void generateDoc(String linkPrefix, PrintStream out) throws JsonMappingException, JsonProcessingException { Set<Class<?>> classes = new TreeSet<>(new Comparator<Class<?>>() { @Override public int compare(Class<?> o1, Class<?> o2) { return o1.getName().compareTo(o2.getName()); } }); classes.addAll(this.classes); f...
Doc { void generateDoc(String linkPrefix, PrintStream out) throws JsonMappingException, JsonProcessingException { Set<Class<?>> classes = new TreeSet<>(new Comparator<Class<?>>() { @Override public int compare(Class<?> o1, Class<?> o2) { return o1.getName().compareTo(o2.getName()); } }); classes.addAll(this.classes); f...
Doc { void generateDoc(String linkPrefix, PrintStream out) throws JsonMappingException, JsonProcessingException { Set<Class<?>> classes = new TreeSet<>(new Comparator<Class<?>>() { @Override public int compare(Class<?> o1, Class<?> o2) { return o1.getName().compareTo(o2.getName()); } }); classes.addAll(this.classes); f...
@Test public void testComputeRecordProcRateAtPhaseHostLevel() { int major = 1; String hostname1 = "hostname1"; String hostname2 = "hostname2"; HostProcessingRate hpr1 = new HostProcessingRate(major, hostname1, BigInteger.valueOf(5), BigInteger.valueOf(5_000_000_000L), BigInteger.valueOf(1)); HostProcessingRate hpr2 = n...
public static Set<HostProcessingRate> computeRecordProcRateAtPhaseHostLevel(int major, Set<HostProcessingRate> hostProcessingRateSet) { if (hostProcessingRateSet == null || hostProcessingRateSet.isEmpty()) { return new TreeSet<>(); } Table<String, String, BigInteger> hostToColumnToValueTable = HashBasedTable.create(); ...
HostProcessingRateUtil { public static Set<HostProcessingRate> computeRecordProcRateAtPhaseHostLevel(int major, Set<HostProcessingRate> hostProcessingRateSet) { if (hostProcessingRateSet == null || hostProcessingRateSet.isEmpty()) { return new TreeSet<>(); } Table<String, String, BigInteger> hostToColumnToValueTable = ...
HostProcessingRateUtil { public static Set<HostProcessingRate> computeRecordProcRateAtPhaseHostLevel(int major, Set<HostProcessingRate> hostProcessingRateSet) { if (hostProcessingRateSet == null || hostProcessingRateSet.isEmpty()) { return new TreeSet<>(); } Table<String, String, BigInteger> hostToColumnToValueTable = ...
HostProcessingRateUtil { public static Set<HostProcessingRate> computeRecordProcRateAtPhaseHostLevel(int major, Set<HostProcessingRate> hostProcessingRateSet) { if (hostProcessingRateSet == null || hostProcessingRateSet.isEmpty()) { return new TreeSet<>(); } Table<String, String, BigInteger> hostToColumnToValueTable = ...
HostProcessingRateUtil { public static Set<HostProcessingRate> computeRecordProcRateAtPhaseHostLevel(int major, Set<HostProcessingRate> hostProcessingRateSet) { if (hostProcessingRateSet == null || hostProcessingRateSet.isEmpty()) { return new TreeSet<>(); } Table<String, String, BigInteger> hostToColumnToValueTable = ...
@Test public void testComputeRecordProcRateAtPhaseOperatorHostLevel() { int major = 1; int minor1 = 1; int minor2 = 2; int minor3 = 3; String hostname1 = "hostname1"; String hostname2 = "hostname2"; Table<Integer, Integer, String> majorMinorHostTable = HashBasedTable.create(); majorMinorHostTable.put(major, minor1, hos...
public static Set<HostProcessingRate> computeRecordProcRateAtPhaseOperatorHostLevel(int major, List<ImmutablePair<UserBitShared.OperatorProfile, Integer>> ops, Table<Integer, Integer, String> majorMinorHostTable) { Table<String, String, BigInteger> hostToColumnToValueTable = HashBasedTable.create(); buildOperatorHostMe...
HostProcessingRateUtil { public static Set<HostProcessingRate> computeRecordProcRateAtPhaseOperatorHostLevel(int major, List<ImmutablePair<UserBitShared.OperatorProfile, Integer>> ops, Table<Integer, Integer, String> majorMinorHostTable) { Table<String, String, BigInteger> hostToColumnToValueTable = HashBasedTable.crea...
HostProcessingRateUtil { public static Set<HostProcessingRate> computeRecordProcRateAtPhaseOperatorHostLevel(int major, List<ImmutablePair<UserBitShared.OperatorProfile, Integer>> ops, Table<Integer, Integer, String> majorMinorHostTable) { Table<String, String, BigInteger> hostToColumnToValueTable = HashBasedTable.crea...
HostProcessingRateUtil { public static Set<HostProcessingRate> computeRecordProcRateAtPhaseOperatorHostLevel(int major, List<ImmutablePair<UserBitShared.OperatorProfile, Integer>> ops, Table<Integer, Integer, String> majorMinorHostTable) { Table<String, String, BigInteger> hostToColumnToValueTable = HashBasedTable.crea...
HostProcessingRateUtil { public static Set<HostProcessingRate> computeRecordProcRateAtPhaseOperatorHostLevel(int major, List<ImmutablePair<UserBitShared.OperatorProfile, Integer>> ops, Table<Integer, Integer, String> majorMinorHostTable) { Table<String, String, BigInteger> hostToColumnToValueTable = HashBasedTable.crea...
@Test public void testGetMetricsTableHandlesNotRegisteredMetrics() throws IOException { OperatorProfile op = OperatorProfile .newBuilder().addMetric( UserBitShared.MetricValue.newBuilder() .setMetricId(1) .setDoubleValue(200)) .addMetric( UserBitShared.MetricValue.newBuilder() .setMetricId(3) .setDoubleValue(21)) .setO...
public void addMetrics(JsonGenerator generator) throws IOException { if (operatorType == null) { return; } final Integer[] metricIds = OperatorMetricRegistry.getMetricIds(coreOperatorTypeMetricsMap, operatorType.getNumber()); if (metricIds.length == 0) { return; } generator.writeFieldName("metrics"); final String[] met...
OperatorWrapper { public void addMetrics(JsonGenerator generator) throws IOException { if (operatorType == null) { return; } final Integer[] metricIds = OperatorMetricRegistry.getMetricIds(coreOperatorTypeMetricsMap, operatorType.getNumber()); if (metricIds.length == 0) { return; } generator.writeFieldName("metrics"); ...
OperatorWrapper { public void addMetrics(JsonGenerator generator) throws IOException { if (operatorType == null) { return; } final Integer[] metricIds = OperatorMetricRegistry.getMetricIds(coreOperatorTypeMetricsMap, operatorType.getNumber()); if (metricIds.length == 0) { return; } generator.writeFieldName("metrics"); ...
OperatorWrapper { public void addMetrics(JsonGenerator generator) throws IOException { if (operatorType == null) { return; } final Integer[] metricIds = OperatorMetricRegistry.getMetricIds(coreOperatorTypeMetricsMap, operatorType.getNumber()); if (metricIds.length == 0) { return; } generator.writeFieldName("metrics"); ...
OperatorWrapper { public void addMetrics(JsonGenerator generator) throws IOException { if (operatorType == null) { return; } final Integer[] metricIds = OperatorMetricRegistry.getMetricIds(coreOperatorTypeMetricsMap, operatorType.getNumber()); if (metricIds.length == 0) { return; } generator.writeFieldName("metrics"); ...
@Test public void testFormatNanos() { assertEquals("123us", SimpleDurationFormat.formatNanos(123456)); assertEquals("456ns", SimpleDurationFormat.formatNanos(456)); assertEquals("825ms", SimpleDurationFormat.formatNanos(825435267)); assertEquals("1.825s", SimpleDurationFormat.formatNanos(1825435267)); assertEquals("30m...
static String formatNanos(long durationInNanos) { if (durationInNanos < 1) { return "0s"; } final long days = TimeUnit.NANOSECONDS.toDays(durationInNanos); final long hours = TimeUnit.NANOSECONDS.toHours(durationInNanos) - TimeUnit.DAYS.toHours(TimeUnit.NANOSECONDS.toDays(durationInNanos)); final long minutes = TimeUni...
SimpleDurationFormat { static String formatNanos(long durationInNanos) { if (durationInNanos < 1) { return "0s"; } final long days = TimeUnit.NANOSECONDS.toDays(durationInNanos); final long hours = TimeUnit.NANOSECONDS.toHours(durationInNanos) - TimeUnit.DAYS.toHours(TimeUnit.NANOSECONDS.toDays(durationInNanos)); final...
SimpleDurationFormat { static String formatNanos(long durationInNanos) { if (durationInNanos < 1) { return "0s"; } final long days = TimeUnit.NANOSECONDS.toDays(durationInNanos); final long hours = TimeUnit.NANOSECONDS.toHours(durationInNanos) - TimeUnit.DAYS.toHours(TimeUnit.NANOSECONDS.toDays(durationInNanos)); final...
SimpleDurationFormat { static String formatNanos(long durationInNanos) { if (durationInNanos < 1) { return "0s"; } final long days = TimeUnit.NANOSECONDS.toDays(durationInNanos); final long hours = TimeUnit.NANOSECONDS.toHours(durationInNanos) - TimeUnit.DAYS.toHours(TimeUnit.NANOSECONDS.toDays(durationInNanos)); final...
SimpleDurationFormat { static String formatNanos(long durationInNanos) { if (durationInNanos < 1) { return "0s"; } final long days = TimeUnit.NANOSECONDS.toDays(durationInNanos); final long hours = TimeUnit.NANOSECONDS.toHours(durationInNanos) - TimeUnit.DAYS.toHours(TimeUnit.NANOSECONDS.toDays(durationInNanos)); final...
@Test public void testOutcomeReasonCancelled() throws Exception { JobResultToLogEntryConverter converter = new JobResultToLogEntryConverter(); Job job = mock(Job.class); JobAttempt jobAttempt = new JobAttempt(); JobInfo jobInfo = new JobInfo(); JobId jobId = new JobId(); jobId.setId("testId"); final String cancelReason...
@Override public LoggedQuery apply(Job job) { final JobInfo info = job.getJobAttempt().getInfo(); final List<String> contextList = info.getContextList(); String outcomeReason = null; switch(job.getJobAttempt().getState()) { case CANCELED: outcomeReason = info.getCancellationInfo().getMessage(); break; case FAILED: outc...
JobResultToLogEntryConverter implements Function<Job, LoggedQuery> { @Override public LoggedQuery apply(Job job) { final JobInfo info = job.getJobAttempt().getInfo(); final List<String> contextList = info.getContextList(); String outcomeReason = null; switch(job.getJobAttempt().getState()) { case CANCELED: outcomeReaso...
JobResultToLogEntryConverter implements Function<Job, LoggedQuery> { @Override public LoggedQuery apply(Job job) { final JobInfo info = job.getJobAttempt().getInfo(); final List<String> contextList = info.getContextList(); String outcomeReason = null; switch(job.getJobAttempt().getState()) { case CANCELED: outcomeReaso...
JobResultToLogEntryConverter implements Function<Job, LoggedQuery> { @Override public LoggedQuery apply(Job job) { final JobInfo info = job.getJobAttempt().getInfo(); final List<String> contextList = info.getContextList(); String outcomeReason = null; switch(job.getJobAttempt().getState()) { case CANCELED: outcomeReaso...
JobResultToLogEntryConverter implements Function<Job, LoggedQuery> { @Override public LoggedQuery apply(Job job) { final JobInfo info = job.getJobAttempt().getInfo(); final List<String> contextList = info.getContextList(); String outcomeReason = null; switch(job.getJobAttempt().getState()) { case CANCELED: outcomeReaso...
@Test public void testOutcomeReasonFailed() throws Exception { JobResultToLogEntryConverter converter = new JobResultToLogEntryConverter(); Job job = mock(Job.class); JobAttempt jobAttempt = new JobAttempt(); JobInfo jobInfo = new JobInfo(); JobId jobId = new JobId(); jobId.setId("testId"); final String failureReason =...
@Override public LoggedQuery apply(Job job) { final JobInfo info = job.getJobAttempt().getInfo(); final List<String> contextList = info.getContextList(); String outcomeReason = null; switch(job.getJobAttempt().getState()) { case CANCELED: outcomeReason = info.getCancellationInfo().getMessage(); break; case FAILED: outc...
JobResultToLogEntryConverter implements Function<Job, LoggedQuery> { @Override public LoggedQuery apply(Job job) { final JobInfo info = job.getJobAttempt().getInfo(); final List<String> contextList = info.getContextList(); String outcomeReason = null; switch(job.getJobAttempt().getState()) { case CANCELED: outcomeReaso...
JobResultToLogEntryConverter implements Function<Job, LoggedQuery> { @Override public LoggedQuery apply(Job job) { final JobInfo info = job.getJobAttempt().getInfo(); final List<String> contextList = info.getContextList(); String outcomeReason = null; switch(job.getJobAttempt().getState()) { case CANCELED: outcomeReaso...
JobResultToLogEntryConverter implements Function<Job, LoggedQuery> { @Override public LoggedQuery apply(Job job) { final JobInfo info = job.getJobAttempt().getInfo(); final List<String> contextList = info.getContextList(); String outcomeReason = null; switch(job.getJobAttempt().getState()) { case CANCELED: outcomeReaso...
JobResultToLogEntryConverter implements Function<Job, LoggedQuery> { @Override public LoggedQuery apply(Job job) { final JobInfo info = job.getJobAttempt().getInfo(); final List<String> contextList = info.getContextList(); String outcomeReason = null; switch(job.getJobAttempt().getState()) { case CANCELED: outcomeReaso...
@Test public void testToBuf() { JobProtobuf.JobAttempt resultJobAttempt = toBuf(jobAttemptProtostuff); assertEquals(resultJobAttempt, jobAttemptProtobuf); JobProtobuf.JobFailureInfo jobFailureInfo = toBuf(jobFailureInfoProtoStuff); assertEquals(jobFailureInfoProtoBuf, jobFailureInfo); JobProtobuf.JobCancellationInfo jo...
private static <M extends GeneratedMessageV3, T extends Message<T> & Schema<T>> M toBuf(Parser<M> protobufParser, T protostuff) { try { LinkedBuffer buffer = LinkedBuffer.allocate(); byte[] bytes = ProtobufIOUtil.toByteArray(protostuff, protostuff.cachedSchema(), buffer); return LegacyProtobufSerializer.parseFrom(proto...
JobsProtoUtil { private static <M extends GeneratedMessageV3, T extends Message<T> & Schema<T>> M toBuf(Parser<M> protobufParser, T protostuff) { try { LinkedBuffer buffer = LinkedBuffer.allocate(); byte[] bytes = ProtobufIOUtil.toByteArray(protostuff, protostuff.cachedSchema(), buffer); return LegacyProtobufSerializer...
JobsProtoUtil { private static <M extends GeneratedMessageV3, T extends Message<T> & Schema<T>> M toBuf(Parser<M> protobufParser, T protostuff) { try { LinkedBuffer buffer = LinkedBuffer.allocate(); byte[] bytes = ProtobufIOUtil.toByteArray(protostuff, protostuff.cachedSchema(), buffer); return LegacyProtobufSerializer...
JobsProtoUtil { private static <M extends GeneratedMessageV3, T extends Message<T> & Schema<T>> M toBuf(Parser<M> protobufParser, T protostuff) { try { LinkedBuffer buffer = LinkedBuffer.allocate(); byte[] bytes = ProtobufIOUtil.toByteArray(protostuff, protostuff.cachedSchema(), buffer); return LegacyProtobufSerializer...
JobsProtoUtil { private static <M extends GeneratedMessageV3, T extends Message<T> & Schema<T>> M toBuf(Parser<M> protobufParser, T protostuff) { try { LinkedBuffer buffer = LinkedBuffer.allocate(); byte[] bytes = ProtobufIOUtil.toByteArray(protostuff, protostuff.cachedSchema(), buffer); return LegacyProtobufSerializer...
@Test public void testToStuff() { JobAttempt resultJobAttempt = toStuff(jobAttemptProtobuf); assertEquals(resultJobAttempt, jobAttemptProtostuff); JobFailureInfo jobFailureInfo = toStuff(jobFailureInfoProtoBuf); assertEquals(jobFailureInfoProtoStuff, jobFailureInfo); JobCancellationInfo jobCancellationInfo = toStuff(jo...
private static <M extends GeneratedMessageV3, T extends Message<T> & Schema<T>> T toStuff(Schema<T> protostuffSchema, M protobuf) { T message = protostuffSchema.newMessage(); ProtobufIOUtil.mergeFrom(protobuf.toByteArray(), message, protostuffSchema); return message; }
JobsProtoUtil { private static <M extends GeneratedMessageV3, T extends Message<T> & Schema<T>> T toStuff(Schema<T> protostuffSchema, M protobuf) { T message = protostuffSchema.newMessage(); ProtobufIOUtil.mergeFrom(protobuf.toByteArray(), message, protostuffSchema); return message; } }
JobsProtoUtil { private static <M extends GeneratedMessageV3, T extends Message<T> & Schema<T>> T toStuff(Schema<T> protostuffSchema, M protobuf) { T message = protostuffSchema.newMessage(); ProtobufIOUtil.mergeFrom(protobuf.toByteArray(), message, protostuffSchema); return message; } private JobsProtoUtil(); }
JobsProtoUtil { private static <M extends GeneratedMessageV3, T extends Message<T> & Schema<T>> T toStuff(Schema<T> protostuffSchema, M protobuf) { T message = protostuffSchema.newMessage(); ProtobufIOUtil.mergeFrom(protobuf.toByteArray(), message, protostuffSchema); return message; } private JobsProtoUtil(); static J...
JobsProtoUtil { private static <M extends GeneratedMessageV3, T extends Message<T> & Schema<T>> T toStuff(Schema<T> protostuffSchema, M protobuf) { T message = protostuffSchema.newMessage(); ProtobufIOUtil.mergeFrom(protobuf.toByteArray(), message, protostuffSchema); return message; } private JobsProtoUtil(); static J...
@Test public void testArrowSchemaConversion() { byte[] schema = Base64.getDecoder().decode(OLD_SCHEMA); try { BatchSchema.deserialize(schema); fail("Should not be able to process old Schema"); } catch (IndexOutOfBoundsException e) { } ByteString schemaBytes = ByteString.copyFrom(schema); DatasetConfigUpgrade datasetCon...
@VisibleForTesting byte[] convertFromOldSchema(OldSchema oldSchema) { FlatBufferBuilder builder = new FlatBufferBuilder(); int[] fieldOffsets = new int[oldSchema.fieldsLength()]; for (int i = 0; i < oldSchema.fieldsLength(); i++) { fieldOffsets[i] = convertFromOldField(oldSchema.fields(i), builder); } int fieldsOffset ...
DatasetConfigUpgrade extends UpgradeTask implements LegacyUpgradeTask { @VisibleForTesting byte[] convertFromOldSchema(OldSchema oldSchema) { FlatBufferBuilder builder = new FlatBufferBuilder(); int[] fieldOffsets = new int[oldSchema.fieldsLength()]; for (int i = 0; i < oldSchema.fieldsLength(); i++) { fieldOffsets[i] ...
DatasetConfigUpgrade extends UpgradeTask implements LegacyUpgradeTask { @VisibleForTesting byte[] convertFromOldSchema(OldSchema oldSchema) { FlatBufferBuilder builder = new FlatBufferBuilder(); int[] fieldOffsets = new int[oldSchema.fieldsLength()]; for (int i = 0; i < oldSchema.fieldsLength(); i++) { fieldOffsets[i] ...
DatasetConfigUpgrade extends UpgradeTask implements LegacyUpgradeTask { @VisibleForTesting byte[] convertFromOldSchema(OldSchema oldSchema) { FlatBufferBuilder builder = new FlatBufferBuilder(); int[] fieldOffsets = new int[oldSchema.fieldsLength()]; for (int i = 0; i < oldSchema.fieldsLength(); i++) { fieldOffsets[i] ...
DatasetConfigUpgrade extends UpgradeTask implements LegacyUpgradeTask { @VisibleForTesting byte[] convertFromOldSchema(OldSchema oldSchema) { FlatBufferBuilder builder = new FlatBufferBuilder(); int[] fieldOffsets = new int[oldSchema.fieldsLength()]; for (int i = 0; i < oldSchema.fieldsLength(); i++) { fieldOffsets[i] ...
@Test public void testGetEnqueuedTime() { final ResourceSchedulingInfo schedulingInfo = new ResourceSchedulingInfo() .setResourceSchedulingStart(System.currentTimeMillis() - TimeUnit.HOURS.toMillis(3)) .setResourceSchedulingEnd(0L); final JobInfo info = new JobInfo() .setResourceSchedulingInfo(schedulingInfo); final Jo...
public static long getLegacyEnqueuedTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final ResourceSchedulingInfo schedulingInfo = jobInfo.getResourceSchedulingInfo(); if (schedulingInfo == null) { return 0; } final Long schedulingStart = schedulingInfo.getR...
AttemptsHelper { public static long getLegacyEnqueuedTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final ResourceSchedulingInfo schedulingInfo = jobInfo.getResourceSchedulingInfo(); if (schedulingInfo == null) { return 0; } final Long schedulingStart = sc...
AttemptsHelper { public static long getLegacyEnqueuedTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final ResourceSchedulingInfo schedulingInfo = jobInfo.getResourceSchedulingInfo(); if (schedulingInfo == null) { return 0; } final Long schedulingStart = sc...
AttemptsHelper { public static long getLegacyEnqueuedTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final ResourceSchedulingInfo schedulingInfo = jobInfo.getResourceSchedulingInfo(); if (schedulingInfo == null) { return 0; } final Long schedulingStart = sc...
AttemptsHelper { public static long getLegacyEnqueuedTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final ResourceSchedulingInfo schedulingInfo = jobInfo.getResourceSchedulingInfo(); if (schedulingInfo == null) { return 0; } final Long schedulingStart = sc...
@Test public void testGetEnqueuedTimeFailedJob() { final ResourceSchedulingInfo schedulingInfo = new ResourceSchedulingInfo() .setResourceSchedulingStart(System.currentTimeMillis() - TimeUnit.HOURS.toMillis(3)) .setResourceSchedulingEnd(0L); final JobInfo info = new JobInfo() .setResourceSchedulingInfo(schedulingInfo);...
public static long getLegacyEnqueuedTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final ResourceSchedulingInfo schedulingInfo = jobInfo.getResourceSchedulingInfo(); if (schedulingInfo == null) { return 0; } final Long schedulingStart = schedulingInfo.getR...
AttemptsHelper { public static long getLegacyEnqueuedTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final ResourceSchedulingInfo schedulingInfo = jobInfo.getResourceSchedulingInfo(); if (schedulingInfo == null) { return 0; } final Long schedulingStart = sc...
AttemptsHelper { public static long getLegacyEnqueuedTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final ResourceSchedulingInfo schedulingInfo = jobInfo.getResourceSchedulingInfo(); if (schedulingInfo == null) { return 0; } final Long schedulingStart = sc...
AttemptsHelper { public static long getLegacyEnqueuedTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final ResourceSchedulingInfo schedulingInfo = jobInfo.getResourceSchedulingInfo(); if (schedulingInfo == null) { return 0; } final Long schedulingStart = sc...
AttemptsHelper { public static long getLegacyEnqueuedTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final ResourceSchedulingInfo schedulingInfo = jobInfo.getResourceSchedulingInfo(); if (schedulingInfo == null) { return 0; } final Long schedulingStart = sc...
@Test public void testGetPlanningTime() { final ResourceSchedulingInfo schedulingInfo = new ResourceSchedulingInfo() .setResourceSchedulingStart(System.currentTimeMillis() - TimeUnit.HOURS.toMillis(3)) .setResourceSchedulingEnd(0L); final JobInfo info = new JobInfo() .setResourceSchedulingInfo(schedulingInfo); final Jo...
public Long getPlanningTime() { return getDuration(State.PLANNING); }
AttemptsHelper { public Long getPlanningTime() { return getDuration(State.PLANNING); } }
AttemptsHelper { public Long getPlanningTime() { return getDuration(State.PLANNING); } AttemptsHelper(JobAttempt jobAttempt); }
AttemptsHelper { public Long getPlanningTime() { return getDuration(State.PLANNING); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jobAttemp...
AttemptsHelper { public Long getPlanningTime() { return getDuration(State.PLANNING); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jobAttemp...
@Test public void testGetExecutionTime() { final ResourceSchedulingInfo schedulingInfo = new ResourceSchedulingInfo() .setResourceSchedulingStart(System.currentTimeMillis() - TimeUnit.HOURS.toMillis(3)) .setResourceSchedulingEnd(0L); final JobInfo info = new JobInfo() .setResourceSchedulingInfo(schedulingInfo); final J...
public static long getLegacyExecutionTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final JobDetails jobDetails = jobAttempt.getDetails(); if (jobDetails == null) { return 0; } final long startTime = Optional.ofNullable(jobInfo.getStartTime()).orElse(0L); ...
AttemptsHelper { public static long getLegacyExecutionTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final JobDetails jobDetails = jobAttempt.getDetails(); if (jobDetails == null) { return 0; } final long startTime = Optional.ofNullable(jobInfo.getStartTim...
AttemptsHelper { public static long getLegacyExecutionTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final JobDetails jobDetails = jobAttempt.getDetails(); if (jobDetails == null) { return 0; } final long startTime = Optional.ofNullable(jobInfo.getStartTim...
AttemptsHelper { public static long getLegacyExecutionTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final JobDetails jobDetails = jobAttempt.getDetails(); if (jobDetails == null) { return 0; } final long startTime = Optional.ofNullable(jobInfo.getStartTim...
AttemptsHelper { public static long getLegacyExecutionTime(JobAttempt jobAttempt) { final JobInfo jobInfo = jobAttempt.getInfo(); if (jobInfo == null) { return 0; } final JobDetails jobDetails = jobAttempt.getDetails(); if (jobDetails == null) { return 0; } final long startTime = Optional.ofNullable(jobInfo.getStartTim...
@Test public void testGetPendingTime() { Preconditions.checkNotNull(attemptsHelper.getPendingTime()); assertTrue(1L == attemptsHelper.getPendingTime()); }
public Long getPendingTime() { return getDuration(State.PENDING); }
AttemptsHelper { public Long getPendingTime() { return getDuration(State.PENDING); } }
AttemptsHelper { public Long getPendingTime() { return getDuration(State.PENDING); } AttemptsHelper(JobAttempt jobAttempt); }
AttemptsHelper { public Long getPendingTime() { return getDuration(State.PENDING); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jobAttempt)...
AttemptsHelper { public Long getPendingTime() { return getDuration(State.PENDING); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jobAttempt)...
@Test public void testGetMetadataRetrievalTime() { Preconditions.checkNotNull(attemptsHelper.getMetadataRetrievalTime()); assertTrue(1L == attemptsHelper.getMetadataRetrievalTime()); }
public Long getMetadataRetrievalTime() { return getDuration(State.METADATA_RETRIEVAL); }
AttemptsHelper { public Long getMetadataRetrievalTime() { return getDuration(State.METADATA_RETRIEVAL); } }
AttemptsHelper { public Long getMetadataRetrievalTime() { return getDuration(State.METADATA_RETRIEVAL); } AttemptsHelper(JobAttempt jobAttempt); }
AttemptsHelper { public Long getMetadataRetrievalTime() { return getDuration(State.METADATA_RETRIEVAL); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(J...
AttemptsHelper { public Long getMetadataRetrievalTime() { return getDuration(State.METADATA_RETRIEVAL); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(J...
@Test public void testPlanningTime() { Preconditions.checkNotNull(attemptsHelper.getPlanningTime()); assertTrue(1L == attemptsHelper.getPlanningTime()); }
public Long getPlanningTime() { return getDuration(State.PLANNING); }
AttemptsHelper { public Long getPlanningTime() { return getDuration(State.PLANNING); } }
AttemptsHelper { public Long getPlanningTime() { return getDuration(State.PLANNING); } AttemptsHelper(JobAttempt jobAttempt); }
AttemptsHelper { public Long getPlanningTime() { return getDuration(State.PLANNING); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jobAttemp...
AttemptsHelper { public Long getPlanningTime() { return getDuration(State.PLANNING); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jobAttemp...
@Test public void testGetEngineStartTime() { Preconditions.checkNotNull(attemptsHelper.getEngineStartTime()); assertTrue(1L == attemptsHelper.getEngineStartTime()); }
public Long getEngineStartTime() { return getDuration(State.ENGINE_START); }
AttemptsHelper { public Long getEngineStartTime() { return getDuration(State.ENGINE_START); } }
AttemptsHelper { public Long getEngineStartTime() { return getDuration(State.ENGINE_START); } AttemptsHelper(JobAttempt jobAttempt); }
AttemptsHelper { public Long getEngineStartTime() { return getDuration(State.ENGINE_START); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jo...
AttemptsHelper { public Long getEngineStartTime() { return getDuration(State.ENGINE_START); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jo...
@Test public void testGetQueuedTime() { Preconditions.checkNotNull(attemptsHelper.getQueuedTime()); assertTrue(1L == attemptsHelper.getQueuedTime()); }
public Long getQueuedTime() { return getDuration(State.QUEUED); }
AttemptsHelper { public Long getQueuedTime() { return getDuration(State.QUEUED); } }
AttemptsHelper { public Long getQueuedTime() { return getDuration(State.QUEUED); } AttemptsHelper(JobAttempt jobAttempt); }
AttemptsHelper { public Long getQueuedTime() { return getDuration(State.QUEUED); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jobAttempt); ...
AttemptsHelper { public Long getQueuedTime() { return getDuration(State.QUEUED); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jobAttempt); ...
@Test public void testGetExecutionPlanningTime() { Preconditions.checkNotNull(attemptsHelper.getExecutionPlanningTime()); assertTrue(1L == attemptsHelper.getExecutionPlanningTime()); }
public Long getExecutionPlanningTime() { return getDuration(State.EXECUTION_PLANNING); }
AttemptsHelper { public Long getExecutionPlanningTime() { return getDuration(State.EXECUTION_PLANNING); } }
AttemptsHelper { public Long getExecutionPlanningTime() { return getDuration(State.EXECUTION_PLANNING); } AttemptsHelper(JobAttempt jobAttempt); }
AttemptsHelper { public Long getExecutionPlanningTime() { return getDuration(State.EXECUTION_PLANNING); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(J...
AttemptsHelper { public Long getExecutionPlanningTime() { return getDuration(State.EXECUTION_PLANNING); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(J...
@Test public void testDependencySort() throws Exception { UpgradeTask1 upgradeTask1 = new UpgradeTask1(ImmutableList.of()); UpgradeTask2 upgradeTask2 = new UpgradeTask2(ImmutableList.of(upgradeTask1.getTaskUUID())); UpgradeTask3 upgradeTask3 = new UpgradeTask3(ImmutableList.of(upgradeTask1.getTaskUUID(), upgradeTask2.g...
public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks.add(uuidToTask.get(dep)); } ret...
UpgradeTaskDependencyResolver { public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks...
UpgradeTaskDependencyResolver { public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks...
UpgradeTaskDependencyResolver { public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks...
UpgradeTaskDependencyResolver { public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks...
@Test public void testGetStartingTime() { Preconditions.checkNotNull(attemptsHelper.getStartingTime()); assertTrue(1L == attemptsHelper.getStartingTime()); }
public Long getStartingTime() { return getDuration(State.STARTING); }
AttemptsHelper { public Long getStartingTime() { return getDuration(State.STARTING); } }
AttemptsHelper { public Long getStartingTime() { return getDuration(State.STARTING); } AttemptsHelper(JobAttempt jobAttempt); }
AttemptsHelper { public Long getStartingTime() { return getDuration(State.STARTING); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jobAttemp...
AttemptsHelper { public Long getStartingTime() { return getDuration(State.STARTING); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jobAttemp...
@Test public void testGetRunningTime() { Preconditions.checkNotNull(attemptsHelper.getRunningTime()); assertTrue(1L == attemptsHelper.getRunningTime()); }
public Long getRunningTime() { return getDuration(State.RUNNING); }
AttemptsHelper { public Long getRunningTime() { return getDuration(State.RUNNING); } }
AttemptsHelper { public Long getRunningTime() { return getDuration(State.RUNNING); } AttemptsHelper(JobAttempt jobAttempt); }
AttemptsHelper { public Long getRunningTime() { return getDuration(State.RUNNING); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jobAttempt)...
AttemptsHelper { public Long getRunningTime() { return getDuration(State.RUNNING); } AttemptsHelper(JobAttempt jobAttempt); boolean hasStateDurations(); static long getCommandPoolWaitTime(JobAttempt jobAttempt); static long getLegacyEnqueuedTime(JobAttempt jobAttempt); static long getPoolWaitTime(JobAttempt jobAttempt)...
@Test public void testSearch() throws Exception { try(final LegacyKVStoreProvider kvstore = LegacyKVStoreProviderAdapter.inMemory(DremioTest.CLASSPATH_SCAN_RESULT)) { kvstore.start(); final SimpleUserService userGroupService = new SimpleUserService(() -> kvstore); initUserStore(kvstore, userGroupService); assertEquals(...
@Override public Iterable<? extends User> searchUsers(String searchTerm, String sortColumn, SortOrder order, Integer limit) throws IOException { limit = limit == null ? 10000 : limit; if (searchTerm == null || searchTerm.isEmpty()) { return getAllUsers(limit); } final SearchQuery query = SearchQueryUtils.or( SearchQuer...
SimpleUserService implements UserService { @Override public Iterable<? extends User> searchUsers(String searchTerm, String sortColumn, SortOrder order, Integer limit) throws IOException { limit = limit == null ? 10000 : limit; if (searchTerm == null || searchTerm.isEmpty()) { return getAllUsers(limit); } final SearchQu...
SimpleUserService implements UserService { @Override public Iterable<? extends User> searchUsers(String searchTerm, String sortColumn, SortOrder order, Integer limit) throws IOException { limit = limit == null ? 10000 : limit; if (searchTerm == null || searchTerm.isEmpty()) { return getAllUsers(limit); } final SearchQu...
SimpleUserService implements UserService { @Override public Iterable<? extends User> searchUsers(String searchTerm, String sortColumn, SortOrder order, Integer limit) throws IOException { limit = limit == null ? 10000 : limit; if (searchTerm == null || searchTerm.isEmpty()) { return getAllUsers(limit); } final SearchQu...
SimpleUserService implements UserService { @Override public Iterable<? extends User> searchUsers(String searchTerm, String sortColumn, SortOrder order, Integer limit) throws IOException { limit = limit == null ? 10000 : limit; if (searchTerm == null || searchTerm.isEmpty()) { return getAllUsers(limit); } final SearchQu...
@Test public void testCombine() { CoordExecRPC.QueryProgressMetrics metrics1 = CoordExecRPC.QueryProgressMetrics .newBuilder() .setRowsProcessed(100) .build(); CoordExecRPC.QueryProgressMetrics metrics2 = CoordExecRPC.QueryProgressMetrics .newBuilder() .setRowsProcessed(120) .build(); assertEquals(0, MetricsCombiner.co...
private QueryProgressMetrics combine() { long rowsProcessed = executorMetrics .mapToLong(QueryProgressMetrics::getRowsProcessed) .sum(); return QueryProgressMetrics.newBuilder() .setRowsProcessed(rowsProcessed) .build(); }
MetricsCombiner { private QueryProgressMetrics combine() { long rowsProcessed = executorMetrics .mapToLong(QueryProgressMetrics::getRowsProcessed) .sum(); return QueryProgressMetrics.newBuilder() .setRowsProcessed(rowsProcessed) .build(); } }
MetricsCombiner { private QueryProgressMetrics combine() { long rowsProcessed = executorMetrics .mapToLong(QueryProgressMetrics::getRowsProcessed) .sum(); return QueryProgressMetrics.newBuilder() .setRowsProcessed(rowsProcessed) .build(); } private MetricsCombiner(Stream<QueryProgressMetrics> executorMetrics); }
MetricsCombiner { private QueryProgressMetrics combine() { long rowsProcessed = executorMetrics .mapToLong(QueryProgressMetrics::getRowsProcessed) .sum(); return QueryProgressMetrics.newBuilder() .setRowsProcessed(rowsProcessed) .build(); } private MetricsCombiner(Stream<QueryProgressMetrics> executorMetrics); }
MetricsCombiner { private QueryProgressMetrics combine() { long rowsProcessed = executorMetrics .mapToLong(QueryProgressMetrics::getRowsProcessed) .sum(); return QueryProgressMetrics.newBuilder() .setRowsProcessed(rowsProcessed) .build(); } private MetricsCombiner(Stream<QueryProgressMetrics> executorMetrics); }
@Test public void testMergeWithOnlyPlanningProfile() { final UserBitShared.QueryProfile planningProfile = UserBitShared.QueryProfile.newBuilder() .setPlan("PLAN_VALUE") .setQuery("Select * from plan") .setState(UserBitShared.QueryResult.QueryState.COMPLETED) .addStateList(AttemptEvent.newBuilder() .setState(State.COMPL...
static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
@Test public void testMergeWithOnlyPlanningAndTailProfile() { final UserBitShared.QueryProfile planningProfile = UserBitShared.QueryProfile.newBuilder() .setPlan("PLAN_VALUE") .setQuery("Select * from plan") .setState(UserBitShared.QueryResult.QueryState.ENQUEUED) .addStateList(AttemptEvent.newBuilder() .setState(State...
static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
@Test public void testMergeWithOnlyPlanningAndExecutorProfiles() { final CoordinationProtos.NodeEndpoint nodeEndPoint = CoordinationProtos.NodeEndpoint .newBuilder() .setAddress("190.190.0.666") .build(); final UserBitShared.QueryProfile planningProfile = UserBitShared.QueryProfile.newBuilder() .setPlan("PLAN_VALUE") ....
static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
@Test public void testMergeWithOnlyThreeParts() { final CoordinationProtos.NodeEndpoint nodeEndPoint = CoordinationProtos.NodeEndpoint .newBuilder() .setAddress("190.190.0.666") .build(); final UserBitShared.QueryProfile planningProfile = UserBitShared.QueryProfile.newBuilder() .setPlan("PLAN_VALUE") .setQuery("Select ...
static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
@Test public void testMergeWithMultipleExecutorProfiles() { final CoordinationProtos.NodeEndpoint nodeEndPoint1 = CoordinationProtos.NodeEndpoint .newBuilder() .setAddress("190.190.0.66") .build(); final CoordinationProtos.NodeEndpoint nodeEndPoint2 = CoordinationProtos.NodeEndpoint .newBuilder() .setAddress("190.190.0...
static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
@Test public void testFragmentCountFromPlanningProfile() { final UserBitShared.QueryProfile planningProfile = UserBitShared.QueryProfile.newBuilder() .setPlan("PLAN_VALUE") .setQuery("Select * from plan") .setState(UserBitShared.QueryResult.QueryState.COMPLETED) .setTotalFragments(5) .build(); final UserBitShared.Query...
static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
@Test public void testDependencySortLargeTasksNumber() throws Exception { UpgradeTaskAny upgradeTaskAny1 = new UpgradeTaskAny("upgradeTaskAny1","5", ImmutableList.of()); UpgradeTaskAny upgradeTaskAny2 = new UpgradeTaskAny("upgradeTaskAny2", "7", ImmutableList.of()); UpgradeTaskAny upgradeTaskAny3 = new UpgradeTaskAny("...
public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks.add(uuidToTask.get(dep)); } ret...
UpgradeTaskDependencyResolver { public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks...
UpgradeTaskDependencyResolver { public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks...
UpgradeTaskDependencyResolver { public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks...
UpgradeTaskDependencyResolver { public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks...
@Test public void testMergeWithInconsistentExecutorProfiles() { final CoordinationProtos.NodeEndpoint nodeEndPoint = CoordinationProtos.NodeEndpoint .newBuilder() .setAddress("190.190.0.666") .build(); final UserBitShared.QueryProfile planningProfile = UserBitShared.QueryProfile.newBuilder() .setPlan("PLAN_VALUE") .set...
static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
@Test public void testMergeWithInconsistentExecutorProfiles2() { final CoordinationProtos.NodeEndpoint nodeEndPoint = CoordinationProtos.NodeEndpoint .newBuilder() .setAddress("190.190.0.666") .build(); final UserBitShared.QueryProfile planningProfile = UserBitShared.QueryProfile.newBuilder() .setPlan("PLAN_VALUE") .se...
static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } }
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
ProfileMerger { static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile, Stream<ExecutorQueryProfile> executorProfiles) { return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge(); } private ProfileMerger(QueryProfile planningProfile, QueryProfile tailProfile, Stre...
@Test public void ensureDirectFailureOnRpcException() { conn().runCommand(Cmd.expectFail()); }
public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); connector.execute(r); r.executeCommand(cmd); }
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
@Test public void ensureSecondSuccess() { conn( r -> r.connectionFailed(FailureType.CONNECTION, new IllegalStateException()), r -> r.connectionSucceeded(newRemoteConnection()) ).runCommand(Cmd.expectSucceed()); }
public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); connector.execute(r); r.executeCommand(cmd); }
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
@Test public void ensureTimeoutFailAndRecover() { TestReConnection c = conn(200,100,1, r -> { wt(100); r.connectionFailed(FailureType.CONNECTION, new IllegalStateException()); }, r -> r.connectionSucceeded(newRemoteConnection()) ); c.runCommand(Cmd.expectFail()); wt(200); c.runCommand(Cmd.expectSucceed()); }
public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); connector.execute(r); r.executeCommand(cmd); }
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
@Test public void ensureSuccessThenAvailable() { TestReConnection c = conn(r -> r.connectionSucceeded(newRemoteConnection())); c.runCommand(Cmd.expectSucceed()); c.runCommand(Cmd.expectAvailable()); }
public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); connector.execute(r); r.executeCommand(cmd); }
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
@Test public void ensureInActiveCausesReconnection() { TestReConnection c = conn( 100, 100, 1, r -> r.connectionSucceeded(newBadConnection()), r -> { wt(200); r.connectionFailed(FailureType.CONNECTION, new IllegalStateException()); }, r -> r.connectionSucceeded(newRemoteConnection()) ); c.runCommand(Cmd.expectSucceed()...
public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); connector.execute(r); r.executeCommand(cmd); }
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
@Test public void ensureFirstFailsWaiting() throws InterruptedException, ExecutionException { CountDownLatch latch = new CountDownLatch(1); TestReConnection c = conn( 100000, 100, 100, r -> { try { latch.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } r.connectionFailed(FailureType.CONNECTI...
public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); connector.execute(r); r.executeCommand(cmd); }
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
ReconnectingConnection implements Closeable { public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) { if (closed.get()) { cmd.connectionFailed(FailureType.CONNECTION, new IOException("Connection has been closed: " + toString())); } ConnectionRunner r = new ConnectionRunner(); c...
@Test public void testNullException() throws Exception { RpcException.propagateIfPossible(null, Exception.class); }
public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCause(); DremioPBError remoteError = ...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
@Test public void testNonRemoteException() throws Exception { RpcException e = new RpcException("Test message", new Exception()); RpcException.propagateIfPossible(e, Exception.class); }
public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCause(); DremioPBError remoteError = ...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
@Test public void detectLoopTest() throws Exception { UpgradeTask1 upgradeTask1 = new UpgradeTask1(ImmutableList.of()); UpgradeTask2 upgradeTask2 = new UpgradeTask2(ImmutableList.of("UpgradeTask4")); UpgradeTask3 upgradeTask3 = new UpgradeTask3(ImmutableList.of(upgradeTask1.getTaskUUID(), upgradeTask2.getTaskUUID())); ...
public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks.add(uuidToTask.get(dep)); } ret...
UpgradeTaskDependencyResolver { public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks...
UpgradeTaskDependencyResolver { public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks...
UpgradeTaskDependencyResolver { public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks...
UpgradeTaskDependencyResolver { public List<UpgradeTask> topologicalTasksSort() { List<String> resolved = Lists.newArrayList(); for(UpgradeTask task : uuidToTask.values()) { visit(task, resolved, Lists.newArrayList()); } List<UpgradeTask> resolvedTasks = Lists.newArrayList(); for (String dep : resolved) { resolvedTasks...
@Test public void testRemoteTestException() throws Exception { UserRemoteException ure = UserRemoteException.create(UserException .unsupportedError(new UserRpcException(null, "user rpc exception", new TestException("test message"))) .build(logger).getOrCreatePBError(false)); exception.expect(TestException.class); excep...
public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCause(); DremioPBError remoteError = ...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
@Test public void testRemoteRuntimeException() throws Exception { UserRemoteException ure = UserRemoteException.create(UserException .unsupportedError(new UserRpcException(null, "user rpc exception", new RuntimeException("test message"))) .build(logger).getOrCreatePBError(false)); exception.expect(RuntimeException.clas...
public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCause(); DremioPBError remoteError = ...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
RpcException extends IOException { public static <T extends Throwable> void propagateIfPossible(@Nullable RpcException e, Class<T> clazz) throws T { if (e == null) { return; } Throwable cause = e.getCause(); if (!(cause instanceof UserRemoteException)) { return; } UserRemoteException ure = (UserRemoteException) e.getCa...
@Test public void testOf() { if (!valid) { thrown.expect(IllegalArgumentException.class); } KeyPair<String, String> keyPair = KeyPair.of(values); assertNotNull(keyPair); assertEquals(values.get(0), keyPair.getKey1()); assertEquals(values.get(1), keyPair.getKey2()); assertEquals(values, keyPair); }
@SuppressWarnings("unchecked") public static <K1, K2> KeyPair<K1, K2> of(List<Object> list) { checkArgument(list.size() == 2, "list should be of size 2, had actually %s elements", list); final K1 value1 = (K1) list.get(0); final K2 value2 = (K2) list.get(1); return new KeyPair<>(value1, value2); }
KeyPair extends AbstractList<Object> implements CompoundKey { @SuppressWarnings("unchecked") public static <K1, K2> KeyPair<K1, K2> of(List<Object> list) { checkArgument(list.size() == 2, "list should be of size 2, had actually %s elements", list); final K1 value1 = (K1) list.get(0); final K2 value2 = (K2) list.get(1);...
KeyPair extends AbstractList<Object> implements CompoundKey { @SuppressWarnings("unchecked") public static <K1, K2> KeyPair<K1, K2> of(List<Object> list) { checkArgument(list.size() == 2, "list should be of size 2, had actually %s elements", list); final K1 value1 = (K1) list.get(0); final K2 value2 = (K2) list.get(1);...
KeyPair extends AbstractList<Object> implements CompoundKey { @SuppressWarnings("unchecked") public static <K1, K2> KeyPair<K1, K2> of(List<Object> list) { checkArgument(list.size() == 2, "list should be of size 2, had actually %s elements", list); final K1 value1 = (K1) list.get(0); final K2 value2 = (K2) list.get(1);...
KeyPair extends AbstractList<Object> implements CompoundKey { @SuppressWarnings("unchecked") public static <K1, K2> KeyPair<K1, K2> of(List<Object> list) { checkArgument(list.size() == 2, "list should be of size 2, had actually %s elements", list); final K1 value1 = (K1) list.get(0); final K2 value2 = (K2) list.get(1);...
@Test public void testEqualsReturnsFalseAllNull() { assertTrue(KeyUtils.equals(null, null)); }
public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); }
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } }
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } private KeyUtils(); }
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } private KeyUtils(); static boolean equals(Object left, Object right); static int hash(Object... keys...
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } private KeyUtils(); static boolean equals(Object left, Object right); static int hash(Object... keys...
@Test public void testEqualsReturnsFalseLeftNull() { assertFalse(KeyUtils.equals(null, Boolean.TRUE)); }
public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); }
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } }
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } private KeyUtils(); }
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } private KeyUtils(); static boolean equals(Object left, Object right); static int hash(Object... keys...
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } private KeyUtils(); static boolean equals(Object left, Object right); static int hash(Object... keys...
@Test public void testEqualsReturnsFalseRightNull() { assertFalse(KeyUtils.equals(Boolean.TRUE, null)); }
public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); }
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } }
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } private KeyUtils(); }
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } private KeyUtils(); static boolean equals(Object left, Object right); static int hash(Object... keys...
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } private KeyUtils(); static boolean equals(Object left, Object right); static int hash(Object... keys...
@Test public void testEqualsReturnsTrueWithBooleanTrueTrue() { assertTrue(KeyUtils.equals(Boolean.TRUE, Boolean.TRUE)); }
public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); }
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } }
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } private KeyUtils(); }
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } private KeyUtils(); static boolean equals(Object left, Object right); static int hash(Object... keys...
KeyUtils { public static boolean equals(Object left, Object right) { if (left instanceof byte[] && right instanceof byte[]) { return Arrays.equals((byte[]) left, (byte[]) right); } return Objects.equals(left, right); } private KeyUtils(); static boolean equals(Object left, Object right); static int hash(Object... keys...