首页 \ 问答 \ Hadoop Namenode HA和HDFS联合有什么区别(What is difference between Hadoop Namenode HA and HDFS federation)

Hadoop Namenode HA和HDFS联合有什么区别(What is difference between Hadoop Namenode HA and HDFS federation)

我对使用QJM和HDFS联合的Hadoop Namenode HA感到困惑。 两者都使用多个namenode,两者都提供高可用性。 我无法确定用于Namenode高可用性的架构,因为除了QJM外,两者看起来完全相同。

如果这不是这里要讨论的问题类型,请原谅我。


I am a bit confused with Hadoop Namenode HA using QJM and HDFS federation. Both uses multiple namenode and both provides High Availability. I am not able to decide which architecture to used for Namenode High Availability since both looks exactly same except the QJM thing.

Please pardon me if this is not the type of question to be discussed here.


原文:https://stackoverflow.com/questions/44455478
更新时间:2023-06-29 11:06

最满意答案

承诺是通用的,因为它的内部价值各不相同。 所以如果你有一个承诺并且你打电话给.then(x => ...) ,那x的类型是什么? 泛型允许类型检查器正确解释这一点。

要使其正常工作,您需要添加特定类型。 如果它不包含任何数据且仅用于解析/拒绝功能,请使用Promise<void> 。 最终这是一个类型签名,如果你需要,你可以使用Promise<any>


A promise is generic because it varies on its internal value. So if you have a promise and you call .then(x => ...), what is the type of x? The generic allows the type checker to interpret this correctly.

To get this working, you need to add the specific type. If it contains no data and is being used purely for the resolve/reject functionality, use Promise<void>. Ultimately this is a type signature like any other, so you can use Promise<any> if you need to.

相关问答

更多
  • main.ts import {Promise} from 'es6-promise'; const p: Promise = new Promise ( (resolve: (str: string)=>void, reject: (str: string)=>void) => { const a: string = "hello from Promise"; resolve(a); } ); p.then((st) => { console.lo ...
  • 编辑(2016年4月25日):以下答案是旧的,不应被视为最佳答案。 TypeScript现在支持“本地”地图,因此只需输出ES6即可使用ES6 Maps。 对于ES5,它不提供聚合物; 你需要自己嵌入它们。 有关更多信息,请参阅下面的mohamed hegazy的答案,以获得更现代的答案,甚至是一个简短版本的这个reddit评论 。 从1.5.0测试版开始,TypeScript尚不支持Maps 。 也不是路线图的一部分。 当前最好的解决方案是一个具有类型键和值的对象(有时称为hashmap)。 对于具有类型 ...
  • 目前的lib.d.ts没有定义的承诺,所以你需要一个额外的定义文件,这就是为什么你得到编译错误。 您可以使用(如@elclanrs所说)使用具有来自DefinitelyTyped的定义文件的es6-promise包: es6-promise definition 你可以这样使用它: var p = new Promise((resolve, reject) => { resolve('a string'); }); 编辑您可以在定位ES6(使用TypeScript编译器)时使用 ...
  • 如果你的系统有问题。 您需要提供更多信息。 它在操场上工作 enum GameState { PONG, BREAKOUT } namespace Phaser { export interface State { } } class PongState implements Phaser.State { } class BreakoutState implements Phaser.State { } let gameStateMap: Map
  • 说实话? 我用摩卡。 在Mocha中,您可以简单地返回一个promise并且语法非常相似,因为您已经使用Mocha的语法进行异步测试。 它看起来像: describe("Promises", function() { it("should be tested", function() { var promise = functionThatReturnsAPromise(); return promise.then(function(result) { expect(resu ...
  • 试试: import * as bluebird, {Promise} from "bluebird"; Turns out the problem is not with the code shown in my example but with the return type needing to be typed correctly, after sorting that the problem goes away, so really this is not an issue.
  • 承诺是通用的,因为它的内部价值各不相同。 所以如果你有一个承诺并且你打电话给.then(x => ...) ,那x的类型是什么? 泛型允许类型检查器正确解释这一点。 要使其正常工作,您需要添加特定类型。 如果它不包含任何数据且仅用于解析/拒绝功能,请使用Promise 。 最终这是一个类型签名,如果你需要,你可以使用Promise 。 A promise is generic because it varies on its internal value. So if you have ...
  • 他们应该保持两个不同的接口有很好的理由。 $q promises和其他实现之间存在根本区别。 $q chain可以同步并在摘要上运行。 这不适用于其他承诺(即本机Promise )。 在本地和$q承诺共存的TS / ES6应用中, Promise和ng.IPromise接口可以聚合到适合它们的公分母,例如IPromise (不含ng )。 但这没什么意义。 在一段需要$q promise的代码中意外使用本机promise(反之亦然)是你想要做的最后一件事,但如果使用普通的IPromise ,则不会被Type ...
  • 通过使用promise响应上的existing标志将控制流添加到现有用户。 例: public static signup(req: express.Request, res: express.Response) { UserModel.findOne({ email: req.body.email }).exec() .then(existingUser => { if(existingUser) { return Promise.r ...
  • ES6应用程序通常的做法是包含polyfill(例如core-js )。 这应该在每个应用程序之前尽早完成,在其他库之前: import 'core-js/es6'; 考虑到已经使用了aurelia-polyfills ,可以选择性地包含polyfill以避免与aurelia-polyfills碰撞: import 'core-js/es6/promise'; import 'core-js/es6/function'; ... The usual thing for ES6 apps is to ha ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)