Codota Logo
SqlQuery.getSql
Code IndexAdd Codota to your IDE (free)

How to use
getSql
method
in
org.apache.ignite.cache.query.SqlQuery

Best Java code snippets using org.apache.ignite.cache.query.SqlQuery.getSql (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: apache/ignite

/** Handle SQL query. */
private QueryCursor<Cache.Entry<K, V>> sqlQuery(SqlQuery qry) {
  Consumer<BinaryOutputStream> qryWriter = out -> {
    writeCacheInfo(out);
    serDes.writeObject(out, qry.getType());
    serDes.writeObject(out, qry.getSql());
    ClientUtils.collection(qry.getArgs(), out, serDes::writeObject);
    out.writeBoolean(qry.isDistributedJoins());
    out.writeBoolean(qry.isLocal());
    out.writeBoolean(qry.isReplicatedOnly());
    out.writeInt(qry.getPageSize());
    out.writeLong(qry.getTimeout());
  };
  return new ClientQueryCursor<>(new ClientQueryPager<>(
    ch,
    ClientOperation.QUERY_SQL,
    ClientOperation.QUERY_SQL_CURSOR_GET_PAGE,
    qryWriter,
    keepBinary,
    marsh
  ));
}
origin: apache/ignite

/** {@inheritDoc} */
@SuppressWarnings("deprecation")
@Override public SqlFieldsQuery generateFieldsQuery(String cacheName, SqlQuery qry) {
  String schemaName = schema(cacheName);
  String type = qry.getType();
  H2TableDescriptor tblDesc = schemaMgr.tableForType(schemaName, cacheName, type);
  if (tblDesc == null)
    throw new IgniteSQLException("Failed to find SQL table for type: " + type,
      IgniteQueryErrorCode.TABLE_NOT_FOUND);
  String sql;
  try {
    sql = H2Utils.generateFieldsQueryString(qry.getSql(), qry.getAlias(), tblDesc);
  }
  catch (IgniteCheckedException e) {
    throw new IgniteException(e);
  }
  SqlFieldsQuery res = new SqlFieldsQuery(sql);
  res.setArgs(qry.getArgs());
  res.setDistributedJoins(qry.isDistributedJoins());
  res.setLocal(qry.isLocal());
  res.setPageSize(qry.getPageSize());
  res.setPartitions(qry.getPartitions());
  res.setReplicatedOnly(qry.isReplicatedOnly());
  res.setSchema(schemaName);
  res.setSql(sql);
  res.setDataPageScanEnabled(qry.isDataPageScanEnabled());
  if (qry.getTimeout() > 0)
    res.setTimeout(qry.getTimeout(), TimeUnit.MILLISECONDS);
  return res;
}
origin: org.apache.ignite/ignite-core

/**
 * @param cctx Cache context.
 * @param qry Query.
 * @param keepBinary Keep binary flag.
 * @return Cursor.
 */
private <K,V> QueryCursor<Cache.Entry<K,V>> queryDistributedSql(final GridCacheContext<?,?> cctx,
  final SqlQuery qry, final boolean keepBinary) {
  checkxEnabled();
  if (!busyLock.enterBusy())
    throw new IllegalStateException("Failed to execute query (grid is stopping).");
  try {
    final String schemaName = idx.schema(cctx.name());
    return executeQuery(GridCacheQueryType.SQL, qry.getSql(), cctx,
      new IgniteOutClosureX<QueryCursor<Cache.Entry<K, V>>>() {
        @Override public QueryCursor<Cache.Entry<K, V>> applyx() throws IgniteCheckedException {
          return idx.queryDistributedSql(schemaName, cctx.name(), qry, keepBinary);
        }
      }, true);
  }
  catch (IgniteCheckedException e) {
    throw new IgniteException(e);
  }
  finally {
    busyLock.leaveBusy();
  }
}
origin: org.apache.ignite/ignite-core

return executeQuery(GridCacheQueryType.SQL, qry.getSql(), cctx,
  new IgniteOutClosureX<QueryCursor<Cache.Entry<K, V>>>() {
    @Override public QueryCursor<Cache.Entry<K, V>> applyx() throws IgniteCheckedException {
origin: org.apache.ignite/ignite-indexing

final SqlQuery qry, final IndexingQueryFilter filter, final boolean keepBinary) throws IgniteCheckedException {
String type = qry.getType();
String sqlQry = qry.getSql();
String alias = qry.getAlias();
Object[] params = qry.getArgs();
origin: org.apache.ignite/ignite-indexing

sql = generateQuery(qry.getSql(), qry.getAlias(), tblDesc);
origin: org.apache.ignite/ignite-core

/** Handle SQL query. */
private QueryCursor<Cache.Entry<K, V>> sqlQuery(SqlQuery qry) {
  Consumer<BinaryOutputStream> qryWriter = out -> {
    writeCacheInfo(out);
    serDes.writeObject(out, qry.getType());
    serDes.writeObject(out, qry.getSql());
    ClientUtils.collection(qry.getArgs(), out, serDes::writeObject);
    out.writeBoolean(qry.isDistributedJoins());
    out.writeBoolean(qry.isLocal());
    out.writeBoolean(qry.isReplicatedOnly());
    out.writeInt(qry.getPageSize());
    out.writeLong(qry.getTimeout());
  };
  return new ClientQueryCursor<>(new ClientQueryPager<>(
    ch,
    ClientOperation.QUERY_SQL,
    ClientOperation.QUERY_SQL_CURSOR_GET_PAGE,
    qryWriter,
    keepBinary,
    marsh
  ));
}
org.apache.ignite.cache.querySqlQuerygetSql

Javadoc

Gets SQL clause.

Popular methods of SqlQuery

  • <init>
    Constructs query for the given type name and SQL query.
  • setArgs
    Sets SQL arguments.
  • getArgs
    Gets SQL arguments.
  • getPageSize
  • getPartitions
    Gets partitions for query, in ascending order.
  • getTimeout
    Gets the query execution timeout in milliseconds.
  • getType
    Gets type for query.
  • isDistributedJoins
    Check if distributed joins are enabled for this query.
  • isLocal
  • isReplicatedOnly
    Check is the query contains only replicated tables.
  • setDistributedJoins
    Specify if distributed joins are enabled for this query. When disabled, join results will only conta
  • setLocal
  • setDistributedJoins,
  • setLocal,
  • setPageSize,
  • setReplicatedOnly,
  • setSql,
  • getAlias,
  • isDataPageScanEnabled,
  • prepare,
  • setAlias

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • addToBackStack (FragmentTransaction)
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JPanel (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now