congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
JsonDatastore
Code IndexAdd Tabnine to your IDE (free)

How to use
JsonDatastore
in
org.datacleaner.connection

Best Java code snippets using org.datacleaner.connection.JsonDatastore (Showing top 9 results out of 315)

origin: datacleaner/DataCleaner

@Override
protected JsonDatastore createDatastore(final String name, final Resource resource) {
  return new JsonDatastore(name, resource);
}
origin: datacleaner/DataCleaner

/**
 * Extrnalizes a Json datastore
 * 
 * @param datastore
 * @param filename
 * @return
 */
public Element toElement(final JsonDatastore datastore, final String filename) {
  final Element datastoreElement = getDocument().createElement("json-datastore");
  datastoreElement.setAttribute("name", datastore.getName());
  final String description = datastore.getDescription();
  if (!Strings.isNullOrEmpty(description)) {
    datastoreElement.setAttribute("description", description);
  }
  appendElement(datastoreElement, "filename", filename);
  return datastoreElement;
}
origin: datacleaner/DataCleaner

/**
 * Creates a {@link Datastore} replacement to use for configured properties
 *
 * @param cb
 * @param datastore
 * @param replacementResource
 * @return a replacement datastore, or null if it shouldn't be replaced
 */
private ResourceDatastore createReplacementDatastore(final ComponentBuilder cb, final ResourceDatastore datastore,
    final Resource replacementResource) {
  final String name = datastore.getName();
  if (datastore instanceof CsvDatastore) {
    final CsvConfiguration csvConfiguration = ((CsvDatastore) datastore).getCsvConfiguration();
    return new CsvDatastore(name, replacementResource, csvConfiguration);
  }
  if (datastore instanceof JsonDatastore) {
    return new JsonDatastore(name, replacementResource, ((JsonDatastore) datastore).getSchemaBuilder());
  }
  logger.warn("Could not replace datastore '{}' because it is of an unsupported type: ", name,
      datastore.getClass().getSimpleName());
  return datastore;
}
origin: datacleaner/DataCleaner

public static boolean isHdfsResourcedDatastore(final Datastore datastore) {
  if (datastore instanceof CsvDatastore) {
    final CsvDatastore csvDatastore = (CsvDatastore) datastore;
    final Resource resource = csvDatastore.getResource();
    if (!isHdfsResource(resource)) {
      return false;
    }
  } else if (datastore instanceof JsonDatastore) {
    final JsonDatastore jsonDatastore = (JsonDatastore) datastore;
    final Resource resource = jsonDatastore.getResource();
    if (!isHdfsResource(resource)) {
      return false;
    }
  } else if (datastore instanceof FixedWidthDatastore) {
    final FixedWidthDatastore fixedWidthDatastore = (FixedWidthDatastore) datastore;
    final Resource resource = fixedWidthDatastore.getResource();
    if (!isHdfsResource(resource)) {
      return false;
    }
  } else {
    // other type of datastore
    return false;
  }
  return true;
}
origin: datacleaner/DataCleaner

  public List<Column> getColumns() {
    if (_columns == null) {
      try (DatastoreConnection openConnection = _jsonDatastore.openConnection()) {
        _columns = openConnection.getDataContext().getDefaultSchema().getTable(0).getColumns();
      }
    }
    return _columns;
  }
}
origin: datacleaner/DataCleaner

  elem = toElement((SalesforceDatastore) datastore);
} else if (datastore instanceof JsonDatastore) {
  final Resource resource = ((JsonDatastore) datastore).getResource();
  final String filename = toFilename(resource);
  elem = toElement((JsonDatastore) datastore, filename);
origin: datacleaner/DataCleaner

private Datastore createDatastore(final String name, final JsonDatastoreType datastoreType,
    final DataCleanerConfiguration configuration) {
  final String filename = getStringVariable("filename", datastoreType.getFilename());
  final Resource resource = _interceptor.createResource(filename, configuration);
  return new JsonDatastore(name, resource);
}
origin: datacleaner/DataCleaner

} else if (datastore instanceof JsonDatastore) {
  final JsonDatastore jsonDatastore = (JsonDatastore) datastore;
  final String datastorePath = jsonDatastore.getResource().getQualifiedPath();
  final JavaRDD<String> rawInput;
  if (_minPartitions != null) {
origin: datacleaner/DataCleaner

  return new DbaseDatastore(datastoreName, resource.getQualifiedPath());
case JSON:
  return new JsonDatastore(datastoreName, resource);
case OPENOFFICE:
  return new OdbDatastore(datastoreName, resource.getQualifiedPath());
org.datacleaner.connectionJsonDatastore

Javadoc

Datastore implementation for JSON files

Most used methods

  • <init>
  • getResource
  • getDescription
  • getName
  • getSchemaBuilder
  • openConnection

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Reference (javax.naming)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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