HBase可以使用HDFS作为后端分布式文件系统.但是,它们的默认块大小完全不同.HBase采用64KB作为默认块大小,而HDFS采用至少64MB作为默认块大小,至少比HBase大1000倍.
我知道HBase是为随机访问而设计的,所以较小的块大小是有帮助的.但是当访问HBase中的64K块时,是否仍然需要访问HDFS中的一个64MB块?如果是真的,HBase可以处理极其随机的访问吗?
我正在使用 kafka binder 测试 spring cloud stream,但出现错误
引起:org.springframework.messaging.MessageDeliveryException:Dispatcher 没有频道“unknown.channel.name”的订阅者。;
pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream</artifactId>
<version>1.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-kafka</artifactId>
<version>1.1.2.RELEASE</version>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
玩具应用程序是模仿秘书在员工和老板之间传递请求。
员工界面:
public interface SecretaryServingEmployee {
@Output
MessageChannel inbox();
@Input
SubscribableChannel rejected();
@Input
SubscribableChannel approved();
}
Run Code Online (Sandbox Code Playgroud)
老板界面:
public interface SecretaryServingBoss {
@Input
SubscribableChannel inbox();
@Output
MessageChannel rejected();
@Output
MessageChannel approved();
}
Run Code Online (Sandbox Code Playgroud)
应用程序属性
server.port=8080
spring.cloud.stream.bindings.inbox.destination=inbox
spring.cloud.stream.bindings.approved.destination=approved
spring.cloud.stream.bindings.rejected.destination=rejected
Run Code Online (Sandbox Code Playgroud)
雇员.java
@EnableBinding(SecretaryServingEmployee.class)
@Component
public class Employee {
private static Logger logger = LoggerFactory.getLogger(Employee.class);
private SecretaryServingEmployee …Run Code Online (Sandbox Code Playgroud) 我试图从kafka读取一条json消息并得到一个例外,其中说Jackson不能将json反序列化为POJO.
json就像{"code":"500","count":22,"from":1528343820000,"to":1528343880000}是kafka流的输出.
POJO声明了json的所有属性,并且与生成json消息的POJO完全相同.所以我不知道为什么会这样.
我正在使用spring cloud stream 2.0.0.RELEASE.
任何帮助,将不胜感激.谢谢.
POJO:
public class CodeCount {
private String code;
private long count;
private Date from;
private Date to;
@Override
public String toString() {
return "CodeCount [code=" + code + ", count=" + count + ", from=" + from + ", to=" + to + "]";
}
public CodeCount(String code, long count, Date from, Date to) {
super();
this.code = code;
this.count = count;
this.from = from;
this.to = to;
}
public …Run Code Online (Sandbox Code Playgroud) 我遇到一个问题,源发送 GenericMessage [payload=xxxxx, ...],而接收器接收消息为 10,120,120,120,120,120。
这个问题是在我设置 Avro 消息转换器后发生的。如果我删除 Avro 消息转换器并使用 StreamListener 来处理消息转换,它将正常工作。
源应用程序.properties
spring.cloud.stream.bindings.toGreeting.destination=greeting
spring.cloud.stream.bindings.toGreeting.contentType=application/*+avro
spring.cloud.stream.schema.avro.dynamicSchemaGenerationEnabled=true
Run Code Online (Sandbox Code Playgroud)
水槽应用
server.port=8990
spring.cloud.stream.bindings.greeting.destination=greeting
Run Code Online (Sandbox Code Playgroud)
消息转换器
@Configuration
@EnableSchemaRegistryClient
public class MessageConverterConfig {
@Bean
public MessageConverter topic1MessageConverter() throws IOException {
return new AvroSchemaMessageConverter(MimeType.valueOf("avro/bytes"));
}
}
Run Code Online (Sandbox Code Playgroud)
应用类
@SpringBootApplication
@EnableSchemaRegistryClient
public class SourceApplication {
public static void main(String[] args) {
SpringApplication.run(SourceApplication.class, args);
}
}
@EnableSchemaRegistryServer
@EnableSchemaRegistryClient
@SpringBootApplication
public class SinkApplication {
public static void main(String[] args) {
SpringApplication.run(SinkApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
我缺少配置吗?谢谢。