mnesia 表不存在 vs 表未加载
如何区分架构中不存在的表和尚未加载的表?
我目前正在使用具有相对较大超时的 mnesia:wait_for_tables() 来检测表,但这是松散的(如果表实际上需要很长时间才能启动会发生什么)并且耗时(如果表确实不存在)。
How can I tell the difference between a table not being present in the schema and a table that has not yet loaded?
I am currently using mnesia:wait_for_tables() with a relatively large timeout to detect a table, but this is loose (what happens if the table actually takes a long time to start) and time consuming (if the table is really not there).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许尝试一下......
这只是一个猜测,但如果没有其他人有明确的答案,它可能会成为实验的基础。
Maybe try...
It's only a guess, but it could be the basis for an experiment if no one else has a definitive answer.
mnesia:table_info/2 可能会有所帮助。
如果你事先知道表名,并且想知道哪些节点有数据,
StorageType 应该是其中之一
如果本地节点没有副本,则返回“未知”。
mnesia:table_info/2 may help.
If you know the table names in advance and you want to know which nodes have data,
StorageType should be one of
or, if you want to know the local node has table copy, just
If the local node does NOT have a copy, this returns 'unknown'.