private static final long serialVersionUID = -3455861209780003757L
private String name
public StrictMap(int initialCapacity, float loadFactor, String name) {
super(initialCapacity, loadFactor)
this.name = name
}
public StrictMap(int initialCapacity, String name) {
super(initialCapacity)
this.name = name
}
public StrictMap(String name) {
this.name = name
}
public String getName() {
return name
}
public void setName(String name) {
this.name = name
}
@Override
public V put(String key, V value) {
if (containsKey(key)) {
throw new RuntimeException("已经存在的key, keyName = " + key)
}
if (key.contains(".")) {
final String shortName = getShortName(key)
if (containsKey(shortName)) {
// question 这边有个问题, 为什么没有抛出ClassCastException。
V ambiguity = (V) new Ambiguity("存在的shortName")
super.put(shortName, ambiguity)
} else {
super.put(shortName, value)
}
}
return super.put(key, value)
}
@Override
public V get(Object key) {
V value = super.get(key)
if (value == null) {
throw new RuntimeException("keyName = " + key + ", 没有获取到value.")
}
if (value instanceof Ambiguity) {
throw new RuntimeException("重复的shortName")
}
return value
}
static class Ambiguity {
private String name
public Ambiguity(String name) {
this.name = name
}
public String getName() {
return name
}
}
}
ps:运行时也没报错。
java强转类型报错
破壁机和料理机的区别
精选推荐
广告
【用Navicat Premium 12连接mysql一报错】2059 - Authentication plugin ‘caching_sha2_password‘ cannot be loaded
229阅读·0评论·0点赞
2021年4月16日
2059 - Authentication plugin ‘caching_sha2_password‘ cannot be loaded
1283阅读·1评论·2点赞
2022年6月11日
解决Navicat远程连接Mysql服务时出错:2059-Authentication plugin ‘caching_sha2_password‘ cannot be loaded
460阅读·0评论·2点赞
2021年8月24日
2059 - Authentication plugin ‘caching_sha2_password‘ cannot be loaded:报错的解决办法
6369阅读·4评论·12点赞
2021年12月6日
MYSQL连接错误码2059解决办法
8796阅读·4评论·5点赞
2022年6月12日
关于Navicat连接MySQL出现2059错误解决方法
6172阅读·5评论·17点赞
2022年3月24日
货运公司
精选推荐
广告
FATAL error 2059 Authentication plugin caching_sha2_password cannot be loaded
373阅读·0评论·1点赞
2020年6月23日
Navicat连接mysql时,提示:Unable to load authentication plugin ‘caching_sha2_password‘.
1365阅读·0评论·3点赞
2022年4月22日
Mysql 连接出现2059错误
5783阅读·0评论·9点赞
2019年9月21日
【亲自验证】Navicat连接MySql提示无法加载身份验证插件“缓存_sha2_密码”?
1705阅读·5评论·1点赞
2021年4月6日
MySQL ERROR 2059——Authentication plugin ‘caching_sha2_password‘ cannot be loaded
230阅读·0评论·0点赞
2021年10月28日
【MySQL】错误代码:2059
361阅读·0评论·0点赞
2022年9月3日
ERROR 2059 (HY000): Authentication plugin ‘sha256_password‘ cannot be loaded: /usr/lib64/mysql/plugi
3391阅读·0评论·0点赞
2021年12月12日
MYSQL 2059问题的解决
135阅读·0评论·0点赞
2021年9月8日
连接mysql报2059错_MySQL连接2059错误解决方法
5437阅读·0评论·3点赞
2021年1月19日
连接 MySQL 报错:2059 - authentication plugin ‘caching_sha2_password‘ cannot be loaded...
968阅读·0评论·1点赞
2021年10月8日
Navicat Premium链接MySQL时出现2059错误解决方法
2618阅读·0评论·2点赞
2022年3月25日
去首页
看看更多热门内容378837147
这是现在流行的大数据处理平台几乎已经成为大数据的代名词,所以这个是必学的。Hadoop里面包括几个组件HDFS、MapReduce和YARN,HDFS是存储数据的地方就像我们电脑的硬盘一样文件都存储在这个上面,MapReduce是对数据进行处理计算的,它有个特点就是不管多大的数据只要给它时间它就能把数据跑完,但是时间可能不是很快所以它叫数据的批处理。YARN是体现Hadoop平台概念的重要组件有了它大数据生态体系的其它软件就能在hadoop上运行了,这样就能更好的利用HDFS大存储的优势和节省更多的资源比如我们就不用再单独建一个spark的集群了,让它直接跑在现有的hadoop yarn上面就可以了。其实把Hadoop的这些组件学明白你就能做大数据的处理了,只不过你现在还可能对"大数据"到底有多大还没有个太清楚的概念,听我的别纠结这个。等以后你工作了就会有很多场景遇到几十T/几百T大规模的数据,到时候你就不会觉得数据大真好,越大越有你头疼的。当然别怕处理这么大规模的数据,因为这是你的价值所在,让那些个搞Javaee的php的html5的和DBA的羡慕去吧。欢迎分享,转载请注明来源:内存溢出
评论列表(0条)