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


Java SerializeUtils.deserializeSnapshot方法代码示例

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


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

示例1: readSnapshotLog

import org.apache.zookeeper.server.util.SerializeUtils; //导入方法依赖的package包/类
private static void readSnapshotLog(String snapshotPath) throws Exception {
  FileInputStream fis = new FileInputStream(snapshotPath);
  BinaryInputArchive ia = BinaryInputArchive.getArchive(fis);
  Map<Long, Integer> sessions = new HashMap<Long, Integer>();
  DataTree dt = new DataTree();
  FileHeader header = new FileHeader();
  header.deserialize(ia, "fileheader");
  if (header.getMagic() != FileSnap.SNAP_MAGIC) {
    throw new IOException("mismatching magic headers " + header.getMagic() + " !=  "
        + FileSnap.SNAP_MAGIC);
  }
  SerializeUtils.deserializeSnapshot(dt, ia, sessions);

  if (bw != null) {
    bw.write(sessions.toString());
    bw.newLine();
  } else {
    System.out.println(sessions);
  }
  traverse(dt, 1, "/");

}
 
开发者ID:apache,项目名称:helix,代码行数:23,代码来源:ZKLogFormatter.java

示例2: deserialize

import org.apache.zookeeper.server.util.SerializeUtils; //导入方法依赖的package包/类
/**
 * deserialize the datatree from an inputarchive
 * @param dt the datatree to be serialized into
 * @param sessions the sessions to be filled up
 * @param ia the input archive to restore from
 * @throws IOException
 */
public void deserialize(DataTree dt, Map<Long, Integer> sessions,
        InputArchive ia) throws IOException {
    FileHeader header = new FileHeader();
    header.deserialize(ia, "fileheader");
    if (header.getMagic() != SNAP_MAGIC) {
        throw new IOException("mismatching magic headers "
                + header.getMagic() + 
                " !=  " + FileSnap.SNAP_MAGIC);
    }
    SerializeUtils.deserializeSnapshot(dt,ia,sessions);
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:19,代码来源:FileSnap.java

示例3: deserialize

import org.apache.zookeeper.server.util.SerializeUtils; //导入方法依赖的package包/类
/**
 * deserialize the datatree from an inputarchive
 * @param dt the datatree to be serialized into
 * @param sessions the sessions to be filled up
 * @param ia the input archive to restore from
 * @throws IOException
 */
public void deserialize(DataTree dt, Map<Long, Integer> sessions,
        InputArchive ia) throws IOException {
    FileHeader header = new FileHeader();
    header.deserialize(ia, "fileheader");
    if (header.getMagic() != SNAP_MAGIC) {
        throw new IOException("mismatching magic headers "
                + header.getMagic() +
                " !=  " + FileSnap.SNAP_MAGIC);
    }
    SerializeUtils.deserializeSnapshot(dt,ia,sessions);
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:19,代码来源:FileSnap.java

示例4: deserialize

import org.apache.zookeeper.server.util.SerializeUtils; //导入方法依赖的package包/类
/**
 * deserialize the datatree from an inputarchive
 * @param dt the datatree to be serialized into
 * @param sessions the sessions to be filled up
 * @param ia the input archive to restore from
 * @throws IOException
 */
public void deserialize(DataTree dt, Map<Long, Integer> sessions,
        InputArchive ia) throws IOException {
    FileHeader header = new FileHeader();
    // 反序列化fileheader
    header.deserialize(ia, "fileheader");
    // 校验魔数
    if (header.getMagic() != SNAP_MAGIC) {
        throw new IOException("mismatching magic headers "
                + header.getMagic() + 
                " !=  " + FileSnap.SNAP_MAGIC);
    }
    // 反序列化内存快照
    SerializeUtils.deserializeSnapshot(dt,ia,sessions);
}
 
开发者ID:txazo,项目名称:zookeeper,代码行数:22,代码来源:FileSnap.java

示例5: deserializeSnapshot

import org.apache.zookeeper.server.util.SerializeUtils; //导入方法依赖的package包/类
/**
 * deserialize a snapshot from an input archive 
 * @param ia the input archive you want to deserialize from
 * @throws IOException
 */
public void deserializeSnapshot(InputArchive ia) throws IOException {
    clear();
    SerializeUtils.deserializeSnapshot(getDataTree(),ia,getSessionWithTimeOuts());
    initialized = true;
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:11,代码来源:ZKDatabase.java

示例6: deserializeSnapshot

import org.apache.zookeeper.server.util.SerializeUtils; //导入方法依赖的package包/类
/**
 * deserialize a snapshot from an input archive
 * @param ia the input archive you want to deserialize from
 * @throws IOException
 */
public void deserializeSnapshot(InputArchive ia) throws IOException {
    clear();
    SerializeUtils.deserializeSnapshot(getDataTree(),ia,getSessionWithTimeOuts());
    initialized = true;
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:11,代码来源:ZKDatabase.java

示例7: deserializeSnapshot

import org.apache.zookeeper.server.util.SerializeUtils; //导入方法依赖的package包/类
/**
 * deserialize a snapshot from an input archive
 * 
 * @param ia
 *            the input archive you want to deserialize from
 * @throws IOException
 */
public void deserializeSnapshot(InputArchive ia) throws IOException {
	clear();
	SerializeUtils.deserializeSnapshot(getDataTree(), ia,
			getSessionWithTimeOuts());
	initialized = true;
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:14,代码来源:ZKDatabase.java


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