小编Lah*_*iru的帖子

在cassandra中创建表时出错 - 错误请求:只能在CLUSTERING ORDER directiv中定义聚类键列

当我尝试使用以下cql语句时,我得到上述错误,不确定它是否有错.

CREATE TABLE Stocks(
  id uuid,
  market text,
  symbol text,
  value text,
  time timestamp,
  PRIMARY KEY(id)
) WITH CLUSTERING ORDER BY (time DESC);
Bad Request: Only clustering key columns can be defined in CLUSTERING ORDER directive
Run Code Online (Sandbox Code Playgroud)

但是这样可以正常工作,我不能使用一些不属于主键的列来排列我的行吗?

CREATE TABLE timeseries (
         ...   event_type text,
         ...   insertion_time timestamp,
         ...   event blob,
         ...   PRIMARY KEY (event_type, insertion_time)
         ... )
         ... WITH CLUSTERING ORDER BY (insertion_time DESC);
Run Code Online (Sandbox Code Playgroud)

cql cassandra

9
推荐指数
1
解决办法
5714
查看次数

如何在 Django 中设置健康检查页面

我有一个需要身份验证才能访问它的任何页面的 web 应用程序。但是为了让我的 ELB 工作,我必须为 ELB 设置健康检查页面,以便 ELB 发现 django 应用程序。

此页面应返回 HTTP 200 且无需身份验证。我如何使用 django/nginx 世界设置它。

django nginx amazon-web-services amazon-elb

8
推荐指数
3
解决办法
1万
查看次数

Scala 的 collection.mutable.PriorityQueue 线程安全吗?

PriorityQueue在多个线程中使用 a 。我不确定它是线程安全的数据结构。

scala.collection.mutable.PriorityQueue跨多个线程使用是否安全?

concurrency scala data-structures

5
推荐指数
1
解决办法
1888
查看次数

Iterables.transform没有迭代我的List

analyticsDatabases的类型 -

private final Iterable<Database> analyticsDatabases;
Run Code Online (Sandbox Code Playgroud)

我在方法中使用下面的代码片段,并且我在analyticsDatabases List中有一个元素.当我做一个for循环时,一切正常,但我很好奇为什么我的Iterables.transform不起作用.

Iterable<Iterable<ObjectId>> finalR = Iterables.transform(analyticsDatabases, new Function<Database, Iterable<ObjectId>>() { 
    @Nullable 
    @Override 
    public Iterable<ObjectId> apply(@Nullable Database database) { 
        if (database != null) { 
            return database.deleteItemsById(filterIds, storableType, writeAckStrategy); 
        } 

        `enter code here`

        return null; 
    } 
});
Run Code Online (Sandbox Code Playgroud)

java collections guava

0
推荐指数
1
解决办法
56
查看次数