代码之家  ›  专栏  ›  技术社区  ›  Laird Nelson

SharedIndexInformer的索引器的ThreadSafeStore是否清空过?

  •  0
  • Laird Nelson  · 技术社区  · 7 年前

    我正在仔细地通过密码 tools/cache package 好像是第一百次了。

    当你创建一个新的 SharedIndexInformer

    1. 共享索引信息 creates a new Indexer
    2. 这个 索引器 如此创造 creates a new ThreadSafeStore 内部保存库伯内特斯资源的表示。
    3. SharedIndexInformer.Run() creates a new DeltaFIFO with the new Indexer
    4. The Indexer supplied to the new DeltaFIFO therefore functions as its KeyLister and its KeyGetter . (这用于跟踪删除的“先前状态”;即,如果其中有一个对象,但与Kubernetes的最新同步不包含该对象,则我们知道该对象已从集群中删除。)
    5. 这个 HandleDeltas function is the one that the underlying controller will call
    6. 函数将调用 Add Update Delete (并且,通过延伸,在其基础上 线程安全存储 ).

    假设我使用 . 让我们进一步说,它正在观察 Pod s、 最后我们说有10个 豆荚 在集群中。

    这是否意味着 共享索引信息 Run 方法,并且经过了一些必要的时间,将有10个JSON表示 豆荚 他在房间里 线程安全存储 ,而且 在实际删除一个相应的 豆荚 s出现在Kubernetes中 ?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Antoine Cotten    7 年前

    正确,除了JSON部分。

    存储包含从protobuf消息反序列化的本机对象结构。

    推荐文章