以下是我的剧本
CREATE TABLE alrashed.tbl_alerts_details (
alert_id int,
action_required int,
alert_agent_id int,
alert_agent_type_id int,
alert_agent_type_name text,
alert_definer_desc text,
alert_definer_name text,
alert_source text,
alert_state text,
col_1 text,
col_2 text,
col_3 text,
col_4 text,
col_5 text,
current_escalation_level text,
date_part date,
device_id text,
driver map<text, text>,
is_processed int,
is_real_time int,
location map<text, text>,
seq_no int,
severity text,
time_stamp timestamp,
transporter map<text, text>,
transporter_name text,
trip_id int,
updated_on timestamp,
vehicle map<text, text>,
vehicle_type_name text,
PRIMARY KEY (alert_id)
) WITH read_repair_chance = 0.0
AND dclocal_read_repair_chance = 0.1
AND gc_grace_seconds = 864000
AND bloom_filter_fp_chance = 0.01
AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
AND comment = ''
AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold' : 32, 'min_threshold' : 4 }
AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
AND default_time_to_live = 0
AND speculative_retry = '99PERCENTILE'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0;
当我运行此查询时,我正在
在一致性LOCAL_ONE读取查询期间Cassandra失败(需要1个响应,但只有0个副本响应,1个失败)错误
这是我在Java中的cassandra查询:
select
count( * )
from
tbl_alerts_details
where
alert_state = 'ACKNOWLEDGE'
and date_part >= '2017-10-01'
and date_part <= '2017-10-31'
and is_real_time = 1
and alert_agent_type_name = 'VEHICLE' ALLOW FILTERING
答案 0 :(得分:1)
This error had made us realise a space issue for us, storing images in Base64 in every row had quickly made the function main()
gridDifference::Float32 = 0.0
stableValue::Float32 = 100.0
counter::Int32 = read(STDIN, Int32)
EPSILON_VALUE::Float32 = read(STDIN, Float32)
NUM_ROWS::Int32 = read(STDIN, Int32)
NUM_COLUMNS::Int32 = read(STDIN, Int32)
initialGrid::Array{Float32,2} = read(STDIN, Float32, NUM_ROWS, NUM_COLUMNS)
newGrid = Array{Float32,2}(NUM_ROWS, NUM_COLUMNS)
for i=2:NUM_COLUMNS - 1, j=2:NUM_ROWS - 1
newGrid[j,i] = 50.0
end
while stableValue > EPSILON_VALUE
stableValue = 0.0
for i in 2:NUM_COLUMNS - 1, j in 2:NUM_ROWS - 1
newGrid[j,i] = (initialGrid[j,i - 1] + initialGrid[j,i + 1] + initialGrid[j + 1,i] + initialGrid[j - 1,i]) / 4
gridDifference = abs(newGrid[j,i] - initialGrid[j,i])
if gridDifference > EPSILON_VALUE
stableValue = gridDifference
end
end
initialGrid = copy(newGrid)
if stableValue > EPSILON_VALUE
counter +=1
end
end
write(STDOUT, counter)
write(STDOUT, EPSILON_VALUE)
write(STDOUT, NUM_ROWS)
write(STDOUT, NUM_COLUMNS)
write(STDOUT, newGrid)
println(STDERR, counter)
println(STDERR, EPSILON_VALUE)
println(STDERR, NUM_ROWS)
println(STDERR, NUM_COLUMNS)
problem arise.
As per this post,
Cassandra doesn't just scan through the rows, but also has to accumulate them in memory while it prepares the response. This can cause an out-of-memory error on the node if things go too far out, and if multiple nodes are servicing the request, it may even cause a multiple failure bringing down the whole cluster. To prevent this from happening, the service aborts the query if it detects a dangerous number of tombstones.