Tabnine Logo
CachedCrudAssist.reload
Code IndexAdd Tabnine to your IDE (free)

How to use
reload
method
in
org.apache.kylin.metadata.cachesync.CachedCrudAssist

Best Java code snippets using org.apache.kylin.metadata.cachesync.CachedCrudAssist.reload (Showing top 18 results out of 315)

origin: apache/kylin

private TableACL loadTableACL(String project) throws IOException {
  TableACL acl = crud.reload(project);
  if (acl == null) {
    acl = newTableACL(project);
  }
  return acl;
}
origin: apache/kylin

public HybridInstance reloadHybridInstance(String name) {
  try (AutoLock l = lock.lockForWrite()) {
    return crud.reload(name);
  }
}

origin: apache/kylin

public DataModelDesc reloadDataModel(String modelName) {
  try (AutoLock lock = modelMapLock.lockForWrite()) {
    return crud.reload(modelName);
  }
}
origin: apache/kylin

CubeInstance reloadCube(String cubeName) {
  try (AutoLock lock = cubeMapLock.lockForWrite()) {
    return crud.reload(cubeName);
  }
}
origin: apache/kylin

public CubeDesc reloadCubeDescLocal(String name) throws IOException {
  try (AutoLock lock = descMapLock.lockForWrite()) {
    CubeDesc ndesc = crud.reload(name);
    clearCuboidCache(name);
    
    // Broken CubeDesc is not allowed to be saved and broadcast.
    if (ndesc.isBroken())
      throw new IllegalStateException("CubeDesc " + name + " is broken");

    return ndesc;
  }
}
origin: apache/kylin

public T save(T entity) throws IOException {
  Preconditions.checkArgument(entity != null);
  completeUuidIfNeeded(entity);
  Preconditions.checkArgument(entityType.isInstance(entity));
  String resName = entity.resourceName();
  Preconditions.checkArgument(resName != null && resName.length() > 0);
  if (checkCopyOnWrite) {
    if (entity.isCachedAndShared() || cache.get(resName) == entity) {
      throw new IllegalStateException("Copy-on-write violation! The updating entity " + entity
          + " is a shared object in " + entityType.getSimpleName() + " cache, which should not be.");
    }
  }
  String path = resourcePath(resName);
  logger.debug("Saving {} at {}", entityType.getSimpleName(), path);
  store.checkAndPutResource(path, entity, serializer);
  
  // just to trigger the event broadcast, the entity won't stay in cache
  cache.put(resName, entity);
  // keep the pass-in entity out of cache, the caller may use it for further update
  // return a reloaded new object
  return reload(resName);
}
origin: apache/kylin

private void updateTempStatementWithRetry(TempStatementEntity entity, int retry) throws IOException {
  try {
    crud.save(entity);
  } catch (WriteConflictException ise) {
    logger.warn("Write conflict to update temp statement" + entity.statementId + " at try " + retry
        + ", will retry...");
    if (retry >= 7) {
      logger.error("Retried 7 times till got error, abandoning...", ise);
      throw ise;
    }
    TempStatementEntity reload = crud.reload(entity.resourceName());
    entity = prepareToOverwrite(entity, reload);
    updateTempStatementWithRetry(entity, ++retry);
  }
}
origin: apache/kylin

cube = crud.reload(cube.getName());
update.setCubeInstance(cube.latestCopyForWrite());
return updateCubeWithRetry(update, ++retry);
origin: apache/kylin

/**
 * the project-specific table desc will be expand by computed columns from the projects' models
 * when the projects' model list changed, project-specific table should be reset and get expanded
 * again
 */
public void resetProjectSpecificTableDesc(String prj) throws IOException {
  // avoid cyclic locks
  ProjectInstance project = ProjectManager.getInstance(config).getProject(prj);
  
  try (AutoLock lock = srcTableMapLock.lockForWrite()) {
    for (String tableName : project.getTables()) {
      String tableIdentity = getTableIdentity(tableName);
      String key = mapKey(tableIdentity, prj);
      TableDesc originTableDesc = srcTableMap.get(key);
      if (originTableDesc == null) {
        continue;
      }
      if (originTableDesc.isBorrowedFromGlobal()) {
        srcTableMap.removeLocal(key);//delete it so that getProjectSpecificTableDesc will create again
      } else {
        srcTableCrud.reload(key);
      }
    }
  }
}
origin: org.apache.kylin/kylin-core-metadata

public DataModelDesc reloadDataModel(String modelName) {
  try (AutoLock lock = modelMapLock.lockForWrite()) {
    return crud.reload(modelName);
  }
}
origin: org.apache.kylin/kylin-core-metadata

private TableACL loadTableACL(String project) throws IOException {
  TableACL acl = crud.reload(project);
  if (acl == null) {
    acl = newTableACL(project);
  }
  return acl;
}
origin: org.apache.kylin/kylin-core-storage

public HybridInstance reloadHybridInstance(String name) {
  try (AutoLock l = lock.lockForWrite()) {
    return crud.reload(name);
  }
}

origin: org.apache.kylin/kylin-core-cube

CubeInstance reloadCube(String cubeName) {
  try (AutoLock lock = cubeMapLock.lockForWrite()) {
    return crud.reload(cubeName);
  }
}
origin: org.apache.kylin/kylin-core-cube

public CubeDesc reloadCubeDescLocal(String name) throws IOException {
  try (AutoLock lock = descMapLock.lockForWrite()) {
    CubeDesc ndesc = crud.reload(name);
    clearCuboidCache(name);
    
    // Broken CubeDesc is not allowed to be saved and broadcast.
    if (ndesc.isBroken())
      throw new IllegalStateException("CubeDesc " + name + " is broken");

    return ndesc;
  }
}
origin: org.apache.kylin/kylin-core-metadata

private void updateTempStatementWithRetry(TempStatementEntity entity, int retry) throws IOException {
  try {
    crud.save(entity);
  } catch (WriteConflictException ise) {
    logger.warn("Write conflict to update temp statement" + entity.statementId + " at try " + retry
        + ", will retry...");
    if (retry >= 7) {
      logger.error("Retried 7 times till got error, abandoning...", ise);
      throw ise;
    }
    TempStatementEntity reload = crud.reload(entity.resourceName());
    entity = prepareToOverwrite(entity, reload);
    updateTempStatementWithRetry(entity, ++retry);
  }
}
origin: org.apache.kylin/kylin-core-metadata

public T save(T entity) throws IOException {
  Preconditions.checkArgument(entity != null);
  completeUuidIfNeeded(entity);
  Preconditions.checkArgument(entityType.isInstance(entity));
  String resName = entity.resourceName();
  Preconditions.checkArgument(resName != null && resName.length() > 0);
  if (checkCopyOnWrite) {
    if (entity.isCachedAndShared() || cache.get(resName) == entity) {
      throw new IllegalStateException("Copy-on-write violation! The updating entity " + entity
          + " is a shared object in " + entityType.getSimpleName() + " cache, which should not be.");
    }
  }
  String path = resourcePath(resName);
  logger.debug("Saving {} at {}", entityType.getSimpleName(), path);
  store.checkAndPutResource(path, entity, serializer);
  
  // just to trigger the event broadcast, the entity won't stay in cache
  cache.put(resName, entity);
  // keep the pass-in entity out of cache, the caller may use it for further update
  // return a reloaded new object
  return reload(resName);
}
origin: org.apache.kylin/kylin-core-cube

cube = crud.reload(cube.getName());
update.setCubeInstance(cube.latestCopyForWrite());
return updateCubeWithRetry(update, ++retry);
origin: org.apache.kylin/kylin-core-metadata

/**
 * the project-specific table desc will be expand by computed columns from the projects' models
 * when the projects' model list changed, project-specific table should be reset and get expanded
 * again
 */
public void resetProjectSpecificTableDesc(String prj) throws IOException {
  // avoid cyclic locks
  ProjectInstance project = ProjectManager.getInstance(config).getProject(prj);
  
  try (AutoLock lock = srcTableMapLock.lockForWrite()) {
    for (String tableName : project.getTables()) {
      String tableIdentity = getTableIdentity(tableName);
      String key = mapKey(tableIdentity, prj);
      TableDesc originTableDesc = srcTableMap.get(key);
      if (originTableDesc == null) {
        continue;
      }
      if (originTableDesc.isBorrowedFromGlobal()) {
        srcTableMap.removeLocal(key);//delete it so that getProjectSpecificTableDesc will create again
      } else {
        srcTableCrud.reload(key);
      }
    }
  }
}
org.apache.kylin.metadata.cachesyncCachedCrudAssistreload

Popular methods of CachedCrudAssist

  • reloadAll
  • reloadQuietly
  • save
  • delete
  • setCheckCopyOnWrite
  • completeUuidIfNeeded
  • copyForWrite
  • getSerializer
  • initEntityAfterReload
  • reloadAt
  • reloadQuietlyAt
  • resourceName
  • reloadQuietlyAt,
  • resourceName,
  • resourcePath

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • setContentView (Activity)
  • Kernel (java.awt.image)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Top Vim plugins
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