Not every data warehouse is necessarily a column store: traditional row-oriented databases and a few other architectures are also used. However, columnar storage can be significantly faster for ad hoc analytical queries, so it is rapidly gaining popularity.
- 摘自《 Designing Data-Intensive Applications 》 101 页
这里 ad hoc 翻译成“临时的”:然而,对于临时的分析查询,列存储可以显著加快速度,因此它正在迅速普及。
```java
Properties properties = new Properties();
properties.load(new FileInputStream("/path/test.properties"));
PropertiesPropertySource propertySource = new PropertiesPropertySource("map", properties);
Iterable<ConfigurationPropertySource> propertySources = ConfigurationPropertySources.from(propertySource);
Binder binder = new Binder(propertySources);
Map map = binder.bind("", Map.class).orElse(null);
System.out.println(map);
```
输出:
{java={runtime={name=OpenJDK Runtime Environment, version=16.0.2+7}, vendor=N/A, specification={version=16, name=Java Platform API Specification, vendor=Oracle Corporation}, class={version=60.0}, vm={version=16.0.2+7, specification={version=16, name=Java Virtual Machine Specification, vendor=Oracle Corporation}, vendor=Oracle Corporation, name=OpenJDK 64-Bit Server VM}, home=/usr/lib/jvm/java-16-openjdk, version=16.0.2}, sun={arch={data={model=64}}}}
用的 Spring Boot 的 API:
import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.boot.context.properties.source.ConfigurationPropertySource;
import org.springframework.boot.context.properties.source.ConfigurationPropertySources;
import org.springframework.core.env.PropertiesPropertySource;