当前位置: 首页>>代码示例>>Java>>正文


Java ScannerModel.getStartTime方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.rest.model.ScannerModel.getStartTime方法的典型用法代码示例。如果您正苦于以下问题:Java ScannerModel.getStartTime方法的具体用法?Java ScannerModel.getStartTime怎么用?Java ScannerModel.getStartTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.rest.model.ScannerModel的用法示例。


在下文中一共展示了ScannerModel.getStartTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import org.apache.hadoop.hbase.rest.model.ScannerModel; //导入方法依赖的package包/类
Response update(final ScannerModel model, final boolean replace,
    final UriInfo uriInfo) {
  servlet.getMetrics().incrementRequests(1);
  if (servlet.isReadOnly()) {
    return Response.status(Response.Status.FORBIDDEN)
      .type(MIMETYPE_TEXT).entity("Forbidden" + CRLF)
      .build();
  }
  byte[] endRow = model.hasEndRow() ? model.getEndRow() : null;
  RowSpec spec = null;
  if (model.getLabels() != null) {
    spec = new RowSpec(model.getStartRow(), endRow, model.getColumns(), model.getStartTime(),
        model.getEndTime(), model.getMaxVersions(), model.getLabels());
  } else {
    spec = new RowSpec(model.getStartRow(), endRow, model.getColumns(), model.getStartTime(),
        model.getEndTime(), model.getMaxVersions());
  }
  MultivaluedMap<String, String> params = uriInfo.getQueryParameters();
  
  try {
    Filter filter = ScannerResultGenerator.buildFilterFromModel(model);
    String tableName = tableResource.getName();
    ScannerResultGenerator gen =
      new ScannerResultGenerator(tableName, spec, filter, model.getCaching(),
        model.getCacheBlocks());
    String id = gen.getID();
    ScannerInstanceResource instance =
      new ScannerInstanceResource(tableName, id, gen, model.getBatch());
    scanners.put(id, instance);
    if (LOG.isDebugEnabled()) {
      LOG.debug("new scanner: " + id);
    }
    UriBuilder builder = uriInfo.getAbsolutePathBuilder();
    URI uri = builder.path(id).build();
    servlet.getMetrics().incrementSucessfulPutRequests(1);
    return Response.created(uri).build();
  } catch (Exception e) {
    servlet.getMetrics().incrementFailedPutRequests(1);
    if (e instanceof TableNotFoundException) {
      return Response.status(Response.Status.NOT_FOUND)
        .type(MIMETYPE_TEXT).entity("Not found" + CRLF)
        .build();
    } else if (e instanceof RuntimeException) {
      return Response.status(Response.Status.BAD_REQUEST)
        .type(MIMETYPE_TEXT).entity("Bad request" + CRLF)
        .build();
    }
    return Response.status(Response.Status.SERVICE_UNAVAILABLE)
      .type(MIMETYPE_TEXT).entity("Unavailable" + CRLF)
      .build();
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:53,代码来源:ScannerResource.java

示例2: update

import org.apache.hadoop.hbase.rest.model.ScannerModel; //导入方法依赖的package包/类
Response update(final ScannerModel model, final boolean replace,
    final UriInfo uriInfo) {
  servlet.getMetrics().incrementRequests(1);
  if (servlet.isReadOnly()) {
    return Response.status(Response.Status.FORBIDDEN)
      .type(MIMETYPE_TEXT).entity("Forbidden" + CRLF)
      .build();
  }
  byte[] endRow = model.hasEndRow() ? model.getEndRow() : null;
  RowSpec spec = null;
  if (model.getLabels() != null) {
    spec = new RowSpec(model.getStartRow(), endRow, model.getColumns(), model.getStartTime(),
        model.getEndTime(), model.getMaxVersions(), model.getLabels());
  } else {
    spec = new RowSpec(model.getStartRow(), endRow, model.getColumns(), model.getStartTime(),
        model.getEndTime(), model.getMaxVersions());
  }

  try {
    Filter filter = ScannerResultGenerator.buildFilterFromModel(model);
    String tableName = tableResource.getName();
    ScannerResultGenerator gen =
      new ScannerResultGenerator(tableName, spec, filter, model.getCaching(),
        model.getCacheBlocks());
    String id = gen.getID();
    ScannerInstanceResource instance =
      new ScannerInstanceResource(tableName, id, gen, model.getBatch());
    scanners.put(id, instance);
    if (LOG.isTraceEnabled()) {
      LOG.trace("new scanner: " + id);
    }
    UriBuilder builder = uriInfo.getAbsolutePathBuilder();
    URI uri = builder.path(id).build();
    servlet.getMetrics().incrementSucessfulPutRequests(1);
    return Response.created(uri).build();
  } catch (Exception e) {
    servlet.getMetrics().incrementFailedPutRequests(1);
    if (e instanceof TableNotFoundException) {
      return Response.status(Response.Status.NOT_FOUND)
        .type(MIMETYPE_TEXT).entity("Not found" + CRLF)
        .build();
    } else if (e instanceof RuntimeException) {
      return Response.status(Response.Status.BAD_REQUEST)
        .type(MIMETYPE_TEXT).entity("Bad request" + CRLF)
        .build();
    }
    return Response.status(Response.Status.SERVICE_UNAVAILABLE)
      .type(MIMETYPE_TEXT).entity("Unavailable" + CRLF)
      .build();
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:52,代码来源:ScannerResource.java

示例3: update

import org.apache.hadoop.hbase.rest.model.ScannerModel; //导入方法依赖的package包/类
Response update(final ScannerModel model, final boolean replace,
    final UriInfo uriInfo) {
  servlet.getMetrics().incrementRequests(1);
  if (servlet.isReadOnly()) {
    return Response.status(Response.Status.FORBIDDEN)
      .type(MIMETYPE_TEXT).entity("Forbidden" + CRLF)
      .build();
  }
  byte[] endRow = model.hasEndRow() ? model.getEndRow() : null;
  RowSpec spec = new RowSpec(model.getStartRow(), endRow,
    model.getColumns(), model.getStartTime(), model.getEndTime(),
    model.getMaxVersions());
  try {
    Filter filter = ScannerResultGenerator.buildFilterFromModel(model);
    String tableName = tableResource.getName();
    ScannerResultGenerator gen =
      new ScannerResultGenerator(tableName, spec, filter, model.getCaching());
    String id = gen.getID();
    ScannerInstanceResource instance =
      new ScannerInstanceResource(tableName, id, gen, model.getBatch());
    scanners.put(id, instance);
    if (LOG.isDebugEnabled()) {
      LOG.debug("new scanner: " + id);
    }
    UriBuilder builder = uriInfo.getAbsolutePathBuilder();
    URI uri = builder.path(id).build();
    servlet.getMetrics().incrementSucessfulPutRequests(1);
    return Response.created(uri).build();
  } catch (Exception e) {
    servlet.getMetrics().incrementFailedPutRequests(1);
    if (e instanceof TableNotFoundException) {
      return Response.status(Response.Status.NOT_FOUND)
        .type(MIMETYPE_TEXT).entity("Not found" + CRLF)
        .build();
    } else if (e instanceof RuntimeException) {
      return Response.status(Response.Status.BAD_REQUEST)
        .type(MIMETYPE_TEXT).entity("Bad request" + CRLF)
        .build();
    }
    return Response.status(Response.Status.SERVICE_UNAVAILABLE)
      .type(MIMETYPE_TEXT).entity("Unavailable" + CRLF)
      .build();
  }
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:45,代码来源:ScannerResource.java


注:本文中的org.apache.hadoop.hbase.rest.model.ScannerModel.getStartTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。