Tabnine Logo
MetricTypeEnum.name
Code IndexAdd Tabnine to your IDE (free)

How to use
name
method
in
org.apache.gobblin.rest.MetricTypeEnum

Best Java code snippets using org.apache.gobblin.rest.MetricTypeEnum.name (Showing top 6 results out of 315)

origin: apache/incubator-gobblin

private void addMetricToBatch(PreparedStatement upsertStatement, Metric metric, String id) throws SQLException {
 Preconditions.checkArgument(!Strings.isNullOrEmpty(id));
 Preconditions.checkArgument(metric.hasGroup());
 Preconditions.checkArgument(metric.hasName());
 Preconditions.checkArgument(metric.hasType());
 Preconditions.checkArgument(metric.hasValue());
 int index = 0;
 upsertStatement.setString(++index, id);
 upsertStatement.setString(++index, metric.getGroup());
 upsertStatement.setString(++index, metric.getName());
 upsertStatement.setString(++index, metric.getType().name());
 upsertStatement.setString(++index, metric.getValue());
 upsertStatement.addBatch();
}
origin: apache/incubator-gobblin

private static boolean existsMetric(Connection connection, String template, String id, Metric metric)
  throws SQLException {
 Preconditions.checkArgument(!Strings.isNullOrEmpty(id));
 Preconditions.checkArgument(metric.hasGroup());
 Preconditions.checkArgument(metric.hasName());
 Preconditions.checkArgument(metric.hasType());
 try (PreparedStatement queryStatement = connection.prepareStatement(template)) {
  int index = 0;
  queryStatement.setString(++index, id);
  queryStatement.setString(++index, metric.getGroup());
  queryStatement.setString(++index, metric.getName());
  queryStatement.setString(++index, metric.getType().name());
  try (ResultSet resultSet = queryStatement.executeQuery()) {
   return resultSet.next();
  }
 }
}
origin: apache/incubator-gobblin

private static void updateMetric(Connection connection, String template, String id, Metric metric, boolean insert)
  throws SQLException {
 Preconditions.checkArgument(!Strings.isNullOrEmpty(id));
 Preconditions.checkArgument(metric.hasGroup());
 Preconditions.checkArgument(metric.hasName());
 Preconditions.checkArgument(metric.hasType());
 Preconditions.checkArgument(metric.hasValue());
 try (PreparedStatement updateStatement = connection.prepareStatement(template)) {
  int index = 0;
  if (insert) {
   updateStatement.setString(++index, id);
   updateStatement.setString(++index, metric.getGroup());
   updateStatement.setString(++index, metric.getName());
   updateStatement.setString(++index, metric.getType().name());
   updateStatement.setString(++index, metric.getValue());
  } else {
   updateStatement.setString(++index, metric.getValue());
   updateStatement.setString(++index, id);
   updateStatement.setString(++index, metric.getGroup());
   updateStatement.setString(++index, metric.getName());
   updateStatement.setString(++index, metric.getType().name());
  }
  updateStatement.executeUpdate();
 }
}
origin: org.apache.gobblin/gobblin-metastore

private static boolean existsMetric(Connection connection, String template, String id, Metric metric)
  throws SQLException {
 Preconditions.checkArgument(!Strings.isNullOrEmpty(id));
 Preconditions.checkArgument(metric.hasGroup());
 Preconditions.checkArgument(metric.hasName());
 Preconditions.checkArgument(metric.hasType());
 try (PreparedStatement queryStatement = connection.prepareStatement(template)) {
  int index = 0;
  queryStatement.setString(++index, id);
  queryStatement.setString(++index, metric.getGroup());
  queryStatement.setString(++index, metric.getName());
  queryStatement.setString(++index, metric.getType().name());
  try (ResultSet resultSet = queryStatement.executeQuery()) {
   return resultSet.next();
  }
 }
}
origin: org.apache.gobblin/gobblin-metastore

private void addMetricToBatch(PreparedStatement upsertStatement, Metric metric, String id) throws SQLException {
 Preconditions.checkArgument(!Strings.isNullOrEmpty(id));
 Preconditions.checkArgument(metric.hasGroup());
 Preconditions.checkArgument(metric.hasName());
 Preconditions.checkArgument(metric.hasType());
 Preconditions.checkArgument(metric.hasValue());
 int index = 0;
 upsertStatement.setString(++index, id);
 upsertStatement.setString(++index, metric.getGroup());
 upsertStatement.setString(++index, metric.getName());
 upsertStatement.setString(++index, metric.getType().name());
 upsertStatement.setString(++index, metric.getValue());
 upsertStatement.addBatch();
}
origin: org.apache.gobblin/gobblin-metastore

private static void updateMetric(Connection connection, String template, String id, Metric metric, boolean insert)
  throws SQLException {
 Preconditions.checkArgument(!Strings.isNullOrEmpty(id));
 Preconditions.checkArgument(metric.hasGroup());
 Preconditions.checkArgument(metric.hasName());
 Preconditions.checkArgument(metric.hasType());
 Preconditions.checkArgument(metric.hasValue());
 try (PreparedStatement updateStatement = connection.prepareStatement(template)) {
  int index = 0;
  if (insert) {
   updateStatement.setString(++index, id);
   updateStatement.setString(++index, metric.getGroup());
   updateStatement.setString(++index, metric.getName());
   updateStatement.setString(++index, metric.getType().name());
   updateStatement.setString(++index, metric.getValue());
  } else {
   updateStatement.setString(++index, metric.getValue());
   updateStatement.setString(++index, id);
   updateStatement.setString(++index, metric.getGroup());
   updateStatement.setString(++index, metric.getName());
   updateStatement.setString(++index, metric.getType().name());
  }
  updateStatement.executeUpdate();
 }
}
org.apache.gobblin.restMetricTypeEnumname

Popular methods of MetricTypeEnum

  • valueOf

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • setContentView (Activity)
  • findViewById (Activity)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Reference (javax.naming)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now