本文整理汇总了Java中org.apache.hadoop.hdfs.server.namenode.INodeAttributes类的典型用法代码示例。如果您正苦于以下问题:Java INodeAttributes类的具体用法?Java INodeAttributes怎么用?Java INodeAttributes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
INodeAttributes类属于org.apache.hadoop.hdfs.server.namenode包,在下文中一共展示了INodeAttributes类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: saveINodeDiffs
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
/**
* Save SnapshotDiff list for an INodeDirectoryWithSnapshot.
* @param sNode The directory that the SnapshotDiff list belongs to.
* @param out The {@link DataOutput} to write.
*/
private static <N extends INode, A extends INodeAttributes, D extends AbstractINodeDiff<N, A, D>>
void saveINodeDiffs(final AbstractINodeDiffList<N, A, D> diffs,
final DataOutput out, ReferenceMap referenceMap) throws IOException {
// Record the diffs in reversed order, so that we can find the correct
// reference for INodes in the created list when loading the FSImage
if (diffs == null) {
out.writeInt(-1); // no diffs
} else {
final List<D> list = diffs.asList();
final int size = list.size();
out.writeInt(size);
for (int i = size - 1; i >= 0; i--) {
list.get(i).write(out, referenceMap);
}
}
}
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:SnapshotFSImageFormat.java
示例2: findByPrimaryKeys
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
private Collection<INodeAttributes> findByPrimaryKeys(
INodeAttributes.Finder qfinder, Object[] params)
throws StorageCallPreventedException, StorageException {
final List<INodeCandidatePrimaryKey> inodePks =
(List<INodeCandidatePrimaryKey>) params[0];
Collection<INodeAttributes> result = null;
if (contains(inodePks)) {
result = get(inodePks);
hit(qfinder, result, "inodeids", inodePks);
} else {
aboutToAccessStorage(qfinder, inodePks);
result = dataAccess.findAttributesByPkList(inodePks);
gotFromDB(result);
miss(qfinder, result, "inodeids", inodePks);
if(result!=null){
for(INodeAttributes iNodeAttributes:result){
log("read-attributes", "id", iNodeAttributes.getInodeId(), "DSQ", iNodeAttributes.getDsQuota(),"DS", iNodeAttributes.getDiskspace(), "NSQ", iNodeAttributes.getNsQuota(), "NS", iNodeAttributes.getNsCount());
}
}
}
return result;
}
开发者ID:hopshadoop,项目名称:hops,代码行数:24,代码来源:INodeAttributesContext.java
示例3: updateAttributes
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
private void updateAttributes(INodeCandidatePrimaryKey trg_param,
List<INodeCandidatePrimaryKey> toBeDeletedSrcs)
throws TransactionContextException {
toBeDeletedSrcs.remove(trg_param);
for (INodeCandidatePrimaryKey src : toBeDeletedSrcs) {
if (contains(src.getInodeId())) {
INodeAttributes toBeDeleted = get(src.getInodeId());
INodeAttributes toBeAdded = clone(toBeDeleted, trg_param.getInodeId());
remove(toBeDeleted);
if(isLogDebugEnabled()) {
log("snapshot-maintenance-removed-inode-attribute", "inodeId",
toBeDeleted.getInodeId());
}
add(toBeAdded);
if(isLogDebugEnabled()) {
log("snapshot-maintenance-added-inode-attribute", "inodeId",
toBeAdded.getInodeId());
}
}
}
}
开发者ID:hopshadoop,项目名称:hops,代码行数:24,代码来源:INodeAttributesContext.java
示例4: update
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
@Override
public void update(INodeAttributes iNodeAttributes)
throws TransactionContextException {
if (iNodeAttributes.getInodeId() != INode.NON_EXISTING_ID) {
super.update(iNodeAttributes);
if(isLogDebugEnabled()){
log("updated-attributes", "id", iNodeAttributes.getInodeId(), "DSQ", iNodeAttributes.getDsQuota(),"DS", iNodeAttributes.getDiskspace(), "NSQ", iNodeAttributes.getNsQuota(), "NS", iNodeAttributes.getNsCount());
}
} else {
if(isLogDebugEnabled()) {
log("updated-attributes -- IGNORED as id is not set");
}
}
}
开发者ID:hopshadoop,项目名称:hops,代码行数:15,代码来源:INodeAttributesContext.java
示例5: remove
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
@Override
public void remove(INodeAttributes iNodeAttributes)
throws TransactionContextException {
super.remove(iNodeAttributes);
if(isLogDebugEnabled()) {
log("removed-attributes", "id", iNodeAttributes.getInodeId());
for(int i = 0; i < Thread.currentThread().getStackTrace().length;i++){
System.out.println(Thread.currentThread().getStackTrace()[i]) ;
}
}
}
开发者ID:hopshadoop,项目名称:hops,代码行数:12,代码来源:INodeAttributesContext.java
示例6: find
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
@Override
public INodeAttributes find(FinderType<INodeAttributes> finder,
Object... params) throws TransactionContextException, StorageException {
INodeAttributes.Finder qfinder = (INodeAttributes.Finder) finder;
switch (qfinder) {
case ByINodeId:
return findByPrimaryKey(qfinder, params);
}
throw new UnsupportedOperationException(UNSUPPORTED_FINDER);
}
开发者ID:hopshadoop,项目名称:hops,代码行数:11,代码来源:INodeAttributesContext.java
示例7: findList
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
@Override
public Collection<INodeAttributes> findList(
FinderType<INodeAttributes> finder, Object... params)
throws TransactionContextException, StorageException {
INodeAttributes.Finder qfinder = (INodeAttributes.Finder) finder;
switch (qfinder) {
case ByINodeIds:
return findByPrimaryKeys(qfinder, params);
}
throw new UnsupportedOperationException(UNSUPPORTED_FINDER);
}
开发者ID:hopshadoop,项目名称:hops,代码行数:12,代码来源:INodeAttributesContext.java
示例8: prepare
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
@Override
public void prepare(TransactionLocks tlm)
throws TransactionContextException, StorageException {
Collection<INodeAttributes> modified =
new ArrayList<>(getModified());
modified.addAll(getAdded());
dataAccess.prepare(modified, getRemoved());
}
开发者ID:hopshadoop,项目名称:hops,代码行数:9,代码来源:INodeAttributesContext.java
示例9: findByPrimaryKey
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
private INodeAttributes findByPrimaryKey(INodeAttributes.Finder qfinder,
Object[] params) throws StorageCallPreventedException, StorageException {
final int inodeId = (Integer) params[0];
INodeAttributes result = null;
if (contains(inodeId)) {
result = get(inodeId);
hit(qfinder, result, "inodeid", inodeId);
} else {
aboutToAccessStorage(qfinder, params);
result = dataAccess.findAttributesByPk(inodeId);
gotFromDB(inodeId, result);
miss(qfinder, result, "inodeid", inodeId, "size", size());
}
return result;
}
开发者ID:hopshadoop,项目名称:hops,代码行数:16,代码来源:INodeAttributesContext.java
示例10: get
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
private Collection<INodeAttributes> get(
List<INodeCandidatePrimaryKey> iNodeCandidatePKs) {
Collection<INodeAttributes> iNodeAttributeses =
new ArrayList<>(iNodeCandidatePKs.size());
for (INodeCandidatePrimaryKey pk : iNodeCandidatePKs) {
iNodeAttributeses.add(get(pk.getInodeId()));
}
return iNodeAttributeses;
}
开发者ID:hopshadoop,项目名称:hops,代码行数:10,代码来源:INodeAttributesContext.java
示例11: acquireINodeAttributes
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
protected void acquireINodeAttributes()
throws StorageException, TransactionContextException {
List<INodeCandidatePrimaryKey> pks =
new ArrayList<>();
for (INode inode : getAllResolvedINodes()) {
if (inode instanceof INodeDirectoryWithQuota) {
INodeCandidatePrimaryKey pk =
new INodeCandidatePrimaryKey(inode.getId());
pks.add(pk);
}
}
acquireLockList(DEFAULT_LOCK_TYPE, INodeAttributes.Finder.ByINodeIds, pks);
}
开发者ID:hopshadoop,项目名称:hops,代码行数:14,代码来源:BaseINodeLock.java
示例12: INodeAttributesContext
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
public INodeAttributesContext(
INodeAttributesDataAccess<INodeAttributes> dataAccess) {
this.dataAccess = dataAccess;
}
开发者ID:hopshadoop,项目名称:hops,代码行数:5,代码来源:INodeAttributesContext.java
示例13: getKey
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
@Override
Integer getKey(INodeAttributes iNodeAttributes) {
return iNodeAttributes.getInodeId();
}
开发者ID:hopshadoop,项目名称:hops,代码行数:5,代码来源:INodeAttributesContext.java
示例14: clone
import org.apache.hadoop.hdfs.server.namenode.INodeAttributes; //导入依赖的package包/类
private INodeAttributes clone(INodeAttributes src, int inodeId) {
return new INodeAttributes(inodeId, src.getNsQuota(), src.getNsCount(),
src.getDsQuota(), src.getDiskspace());
}
开发者ID:hopshadoop,项目名称:hops,代码行数:5,代码来源:INodeAttributesContext.java
注:本文中的org.apache.hadoop.hdfs.server.namenode.INodeAttributes类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论