Кассандра датастакс | TimeoutException

function assignFilePreviews() {
      $( 'input[data-previewable=\"true\"]' ).change(function() {
          var prvCnt = $(this).attr('data-preview-container');
          if(prvCnt) {
            if (this.files && this.files[0]) {
              var reader = new FileReader();
              reader.onload = function (e) {
                var img = $('<img>');
                img.attr('src', e.target.result);
                img.error(function() {
                  $(prvCnt).html('');
                });
                $(prvCnt).html('');
                img.appendTo(prvCnt);
              }
              reader.readAsDataURL(this.files[0]);
          }
        }
      });
    }
$(document).ready(function() {
     assignFilePreviews(); 
});

HTML

<input type="file" data-previewable="true" data-preview-container=".prd-img-prv" /> <div class = "prd-img-prv"></div>

Это также обрабатывает случай, когда выбран файл с недопустимым типом (например, pdf)

0
задан Jayce 28 February 2019 в 09:46
поделиться

2 ответа

  1. Вы не должны использовать «разрешить фильтрацию», если не знаете, что делаете.
  2. SELECT * FROM prod.log ГДЕ db_id = 13913 И db_table LIKE LIMIT 5000 для продукта '%%' истекает, так как у вас, похоже, много записей в БД, и при фильтрации разрешается полное сканирование таблицы. [ 111]
  3. Вы должны адаптировать дизайн таблицы под свои запросы.
0
ответ дан Alex Tbk 28 February 2019 в 09:46
поделиться

Более подробную информацию можно найти здесь.

https://docs.datastax.com/en/developer/php-driver/1.2/api/Cassandra/Cluster/class.Builder/

Использование withConnectTimeout может помочь избежать a TimeoutException

$cluster = $this->cluster()->withConnectTimeout(60);

вы можете увеличить значение тайм-аута. Хотя вы обновляете немного больше, изменяя значения в /etc/cassandra/cassandra.yaml

, как показано ниже -

[118 ] sudo nano /etc/cassandra/cassandra.yaml (для редактирования файла cassandra.yaml)

# How long the coordinator should wait for read operations to complete
read_request_timeout_in_ms: 50000
# How long the coordinator should wait for seq or index scans to complete
range_request_timeout_in_ms: 100000
# How long the coordinator should wait for writes to complete
write_request_timeout_in_ms: 20000
# How long the coordinator should wait for counter writes to complete
counter_write_request_timeout_in_ms: 50000
# How long a coordinator should continue to retry a CAS operation
# that contends with other proposals for the same row
cas_contention_timeout_in_ms: 10000
# How long the coordinator should wait for truncates to complete
# (This can be much longer, because unless auto_snapshot is disabled
# we need to flush first so we can snapshot before removing the data.)
truncate_request_timeout_in_ms: 600000
# The default timeout for other, miscellaneous operations
request_timeout_in_ms: 100000

# How long before a node logs slow queries. Select queries that take longer than
# this timeout to execute, will generate an aggregated log message, so that slow queries
# can be identified. Set this value to zero to disable slow query logging.
slow_query_log_timeout_in_ms: 5000
0
ответ дан Abhishek 28 February 2019 в 09:46
поделиться
Другие вопросы по тегам:

Похожие вопросы: