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


Golang IndexManager.GetIndexDefnById方法代码示例

本文整理汇总了Golang中github.com/couchbase/indexing/secondary/manager.IndexManager.GetIndexDefnById方法的典型用法代码示例。如果您正苦于以下问题:Golang IndexManager.GetIndexDefnById方法的具体用法?Golang IndexManager.GetIndexDefnById怎么用?Golang IndexManager.GetIndexDefnById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/couchbase/indexing/secondary/manager.IndexManager的用法示例。


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

示例1: cleanSingleIndex_managerTest

func cleanSingleIndex_managerTest(mgr *manager.IndexManager, t *testing.T, id common.IndexDefnId) {

	_, err := mgr.GetIndexDefnById(id)
	if err != nil {
		logging.Infof("cleanupTest() :  cannot find index defn %d.  No cleanup ...", id)
	} else {
		logging.Infof("cleanupTest.cleanupTest() :  found index defn %d.  Cleaning up ...", id)

		mgr.HandleDeleteIndexDDL(id)

		_, err := mgr.GetIndexDefnById(id)
		if err == nil {
			logging.Infof("cleanupTest() :  cannot cleanup index defn %d.  ...", id)
		}
	}
}
开发者ID:jchris,项目名称:indexing,代码行数:16,代码来源:manager_test.go

示例2: cleanupRequestHandlerTest

// clean up
func cleanupRequestHandlerTest(mgr *manager.IndexManager, t *testing.T) {

	_, err := mgr.GetIndexDefnById(common.IndexDefnId(500))
	if err != nil {
		logging.Infof("RequestHandlerTest.cleanupRequestHandlerTest() :  cannot find index defn request_handler_test.  No cleanup ...")
	} else {
		logging.Infof("RequestHandlerTest.cleanupRequestHandlerTest() :  found index defn request_handler_test.  Cleaning up ...")

		err = mgr.HandleDeleteIndexDDL(common.IndexDefnId(500))
		if err != nil {
			t.Fatal(err)
		}
		time.Sleep(time.Duration(1000) * time.Millisecond)

		// double check if we have really cleaned up
		_, err := mgr.GetIndexDefnById(common.IndexDefnId(500))
		if err == nil {
			t.Fatal("RequestHandlerTest.cleanupRequestHandlerTest(): Cannot clean up index defn request_handler_test")
		}
	}
}
开发者ID:jchris,项目名称:indexing,代码行数:22,代码来源:request_handler_test.go

示例3: cleanupStreamMgrTimerTest

// clean up
func cleanupStreamMgrTimerTest(mgr *manager.IndexManager) {

	_, err := mgr.GetIndexDefnById(common.IndexDefnId(406))
	if err != nil {
		logging.Infof("StreamMgrTest.cleanupStreamMgrTimerTest() :  cannot find index defn stream_mgr_timer_test.  No cleanup ...")
	} else {
		logging.Infof("StreamMgrTest.cleanupStreamMgrTimerTest() :  found index defn stream_mgr_timer_test.  Cleaning up ...")

		err = mgr.HandleDeleteIndexDDL(common.IndexDefnId(406))
		if err != nil {
			util.TT.Fatal(err)
		}
		time.Sleep(time.Duration(1000) * time.Millisecond)

		// double check if we have really cleaned up
		_, err := mgr.GetIndexDefnById(common.IndexDefnId(406))
		if err == nil {
			util.TT.Fatal("StreamMgrTest.cleanupStreamMgrTimerTest(): Cannot clean up index defn stream_mgr_timer_test")
		}
	}

	time.Sleep(time.Duration(1000) * time.Millisecond)
}
开发者ID:jchris,项目名称:indexing,代码行数:24,代码来源:stream_timer_test.go


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