zk的樹形數(shù)據(jù)模型是什么

這篇文章主要介紹“zk的樹形數(shù)據(jù)模型是什么”,在日常操作中,相信很多人在zk的樹形數(shù)據(jù)模型是什么問題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”zk的樹形數(shù)據(jù)模型是什么”的疑惑有所幫助!接下來,請(qǐng)跟著小編一起來學(xué)習(xí)吧!

憑借整站使用HTML5建站的創(chuàng)新體驗(yàn)、定制設(shè)計(jì)、設(shè)計(jì)團(tuán)隊(duì)積累與透明式的服務(wù)過程,符合行業(yè)特點(diǎn),專屬顧問根據(jù)企業(yè)產(chǎn)品,消費(fèi)群體屬性,準(zhǔn)確定位;設(shè)計(jì)師以目標(biāo)客戶為中心,以突出品牌官網(wǎng)特性為宗旨,定制專屬網(wǎng)站建設(shè)設(shè)計(jì)方案。

zookeeper的數(shù)據(jù)模型是樹結(jié)構(gòu)

在內(nèi)存數(shù)據(jù)庫中存儲(chǔ)了整顆樹內(nèi)容,包含所有節(jié)點(diǎn)路徑,節(jié)點(diǎn)數(shù)據(jù),狀態(tài)信息

會(huì)定時(shí)將數(shù)據(jù)刷到磁盤上

zk的樹形數(shù)據(jù)模型是什么

數(shù)據(jù)模型表示主要有DataTree DataNode ZKDatabase

datatree是一顆樹結(jié)構(gòu),不包含和客戶端,網(wǎng)絡(luò),請(qǐng)求相關(guān)的業(yè)務(wù)邏輯

dataNode是數(shù)據(jù)存儲(chǔ)的最小單元,保存了節(jié)點(diǎn)數(shù)據(jù)內(nèi)容,ACL列表,狀態(tài),父節(jié)點(diǎn)引用和子節(jié)點(diǎn)列表

zkdatabase是內(nèi)存數(shù)據(jù)庫,管理zk所有會(huì)話,DataTree存儲(chǔ)和事務(wù)日志,定時(shí)將日志刷寫到磁盤

在zookeeper啟動(dòng)時(shí),會(huì)通過磁盤的事務(wù)日志和快照文件恢復(fù)一個(gè)完整的內(nèi)存數(shù)據(jù)庫

zk的樹形數(shù)據(jù)模型是什么

屬性相關(guān)

屬性相關(guān)
private final NodeHashMap nodes;

//監(jiān)聽節(jié)點(diǎn)
private IWatchManager dataWatches;
//監(jiān)聽節(jié)點(diǎn)
private IWatchManager childWatches;

/** cached total size of paths and data for all DataNodes */
//總大小
private final AtomicLong nodeDataSize = new AtomicLong(0);

/** the root of zookeeper tree */
//zookeeper的根節(jié)點(diǎn)
private static final String rootZookeeper = "/";

/** the zookeeper nodes that acts as the management and status node **/
//狀態(tài)管理節(jié)點(diǎn)
private static final String procZookeeper = Quotas.procZookeeper;

/** th will be the string thats stored as a child of root */
//root的一個(gè)子節(jié)點(diǎn)
private static final String procChildZookeeper = procZookeeper.substring(1);

/**
 * the zookeeper quota node that acts as the quota management node for
 * zookeeper
 */
//限額管理節(jié)點(diǎn)
private static final String quotaZookeeper = Quotas.quotaZookeeper;

/** thi是s- will be the string thats stored as a child of /zookeeper */
// /zookeeper的子節(jié)點(diǎn)
private static final String quotaChildZookeeper = quotaZookeeper.substring(procZookeeper.length() + 1);

/**
 * the zookeeper config node that acts as the config management node for
 * zookeeper
 */
//配置管理節(jié)點(diǎn)
private static final String configZookeeper = ZooDefs.CONFIG_NODE;

/** thi是s- will be the string thats stored as a child of /zookeeper */
// 子節(jié)點(diǎn)config節(jié)點(diǎn)
private static final String configChildZookeeper = configZookeeper.substring(procZookeeper.length() + 1);

/**
 * the path trie that keeps track of the quota nodes in thi是s- datatree
 */
//限額節(jié)點(diǎn)關(guān)聯(lián)
private final PathTrie pTrie = new PathTrie();

/**
 * over-the-wire size of znode's stat. Counting the fields of Stat class
 */
//stat 類的field
public static final int STAT_OVERHEAD_BYTES = (6 * 8) + (5 * 4);

/**
 * Thi是s- hashtable li是s-ts the paths of the ephemeral nodes of a session.
 */
//臨時(shí)會(huì)話節(jié)點(diǎn)的相關(guān)路徑
private final Map<Long, HashSet<String>> ephemerals = new ConcurrentHashMap<Long, HashSet<String>>();

/**
 * Thi是s- set contains the paths of all container nodes
 */
// 容器節(jié)點(diǎn)的路徑
private final Set<String> containers = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());

/**
 * Thi是s- set contains the paths of all ttl nodes
 */
//ttl node的相關(guān)路徑
private final Set<String> ttls = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());

private final ReferenceCountedACLCache aclCache = new ReferenceCountedACLCache();

// The maximum number of tree digests that we will keep in our hi是s-tory
public static final int DIGEST_LOG_LIMIT = 1024;

// Dump digest every 128 txns, in hex it's 80, which will make it easier
// to align and compare between servers.
public static final int DIGEST_LOG_INTERVAL = 128;

// If thi是s- i是s- not null, we are actively looking for a target zxid that we
// want to validate the digest for
private ZxidDigest digestFromLoadedSnapshot;

// The digest associated with the highest zxid in the data tree.
private volatile ZxidDigest lastProcessedZxidDigest;

// Will be notified when digest mi是s-match event triggered.
private final Li是s-t<DigestWatcher> digestWatchers = new ArrayLi是s-t<>();

// The hi是s-torical digests li是s-t.
private LinkedLi是s-t<ZxidDigest> digestLog = new LinkedLi是s-t<>();

private final DigestCalculator digestCalculator;

到此,關(guān)于“zk的樹形數(shù)據(jù)模型是什么”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!

網(wǎng)頁名稱:zk的樹形數(shù)據(jù)模型是什么
文章鏈接:http://bm7419.com/article44/jdidee.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營銷、云服務(wù)器網(wǎng)站設(shè)計(jì)公司、企業(yè)網(wǎng)站制作、軟件開發(fā)、定制開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營