Package org.elasticsearch.index.translog

Examples of org.elasticsearch.index.translog.Translog$Source


    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    Button btnCreateSource = new Button(container, SWT.NONE);
    btnCreateSource.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        Source newSource = new Source();
        newSource.setId("Source_" + (table.getItemCount() + 1)); //$NON-NLS-1$
        SourceBindingWrapper sourceBindingWrapper = new SourceBindingWrapper(newSource);
        writableList.add(sourceBindingWrapper);
        tableViewer.setSelection(new StructuredSelection(sourceBindingWrapper));
      }
    });
View Full Code Here


    titleStmt.getTitles().add(title);
    fileDesc.setTitleStmt(titleStmt);
    PubStmt pubStmt = new PubStmt();
    fileDesc.setPubStmt(pubStmt);
    SourceDesc sourceDesc = new SourceDesc();
    Source source = new Source();
    sourceDesc.getSources().add(source);
    fileDesc.setSourceDesc(sourceDesc);   
    meiHead.setFileDesc(fileDesc)
    mei.setMeiHead(meiHead);
    Music music = new Music();
View Full Code Here

            synchronized (mutex) {
                boolean activeInactiveStatusChanges = false;
                for (IndexService indexService : indicesService) {
                    for (IndexShard indexShard : indexService) {
                        long time = threadPool.estimatedTimeInMillis();
                        Translog translog = ((InternalIndexShard) indexShard).translog();
                        ShardIndexingStatus status = shardsIndicesStatus.get(indexShard.shardId());
                        if (status == null) { // not added yet
                            continue;
                        }
                        // check if it is deemed to be inactive (sam translogId and numberOfOperations over a long period of time)
                        if (status.translogId == translog.currentId() && translog.estimatedNumberOfOperations() == 0) {
                            if (status.time == -1) { // first time
                                status.time = time;
                            }
                            // inactive?
                            if (!status.inactive) {
                                if ((time - status.time) > inactiveTime.millis()) {
                                    try {
                                        ((InternalIndexShard) indexShard).engine().updateIndexingBufferSize(Engine.INACTIVE_SHARD_INDEXING_BUFFER);
                                    } catch (EngineClosedException e) {
                                        // ignore
                                        continue;
                                    } catch (FlushNotAllowedEngineException e) {
                                        // ignore
                                        continue;
                                    }
                                    // inactive for this amount of time, mark it
                                    status.inactive = true;
                                    activeInactiveStatusChanges = true;
                                    logger.debug("marking shard [{}][{}] as inactive (inactive_time[{}]), setting size to [{}]", indexShard.shardId().index().name(), indexShard.shardId().id(), inactiveTime, Engine.INACTIVE_SHARD_INDEXING_BUFFER);
                                }
                            }
                        } else {
                            if (status.inactive) {
                                status.inactive = false;
                                activeInactiveStatusChanges = true;
                                logger.debug("marking shard [{}][{}] as active", indexShard.shardId().index().name(), indexShard.shardId().id());
                            }
                            status.time = -1;
                        }
                        status.translogId = translog.currentId();
                        status.translogNumberOfOperations = translog.estimatedNumberOfOperations();
                    }
                }
                if (activeInactiveStatusChanges) {
                    calcAndSetShardIndexingBuffer("shards became active/inactive");
                }
View Full Code Here

                        continue;
                    }

                    final long time = threadPool.estimatedTimeInMillis();

                    Translog translog = ((InternalIndexShard) indexShard).translog();
                    ShardIndexingStatus status = shardsIndicesStatus.get(indexShard.shardId());
                    if (status == null) {
                        status = new ShardIndexingStatus();
                        shardsIndicesStatus.put(indexShard.shardId(), status);
                        changes.add(ShardStatusChangeType.ADDED);
                    }
                    // check if it is deemed to be inactive (sam translogId and numberOfOperations over a long period of time)
                    if (status.translogId == translog.currentId() && translog.estimatedNumberOfOperations() == 0) {
                        if (status.time == -1) { // first time
                            status.time = time;
                        }
                        // inactive?
                        if (status.activeIndexing) {
                            // mark it as inactive only if enough time has passed and there are no ongoing merges going on...
                            if ((time - status.time) > inactiveTime.millis() && indexShard.mergeStats().getCurrent() == 0) {
                                // inactive for this amount of time, mark it
                                activeToInactiveIndexingShards.add(indexShard);
                                status.activeIndexing = false;
                                changes.add(ShardStatusChangeType.BECAME_INACTIVE);
                                logger.debug("marking shard [{}][{}] as inactive (inactive_time[{}]) indexing wise, setting size to [{}]", indexShard.shardId().index().name(), indexShard.shardId().id(), inactiveTime, Engine.INACTIVE_SHARD_INDEXING_BUFFER);
                            }
                        }
                    } else {
                        if (!status.activeIndexing) {
                            status.activeIndexing = true;
                            changes.add(ShardStatusChangeType.BECAME_ACTIVE);
                            logger.debug("marking shard [{}][{}] as active indexing wise", indexShard.shardId().index().name(), indexShard.shardId().id());
                        }
                        status.time = -1;
                    }
                    status.translogId = translog.currentId();
                    status.translogNumberOfOperations = translog.estimatedNumberOfOperations();

                    if (status.activeIndexing) {
                        activeShards++;
                    }
                }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void connect(PipeTasks pipeTasks) {
    Source source;
    int taskSourceCount;
   
    // Get the input task. A sink only has one input, this corresponds to
    // pipe index 0.
    source = (Source) getInputTask(pipeTasks, 0, Source.class);
   
    // Cast the input feed to the correct type.
    // Connect the tasks.
    source.setSink(task);
   
    // Register all the sources provided by this task as outputs.
    taskSourceCount = task.getSourceCount();
    for (int i = 0; i < taskSourceCount; i++) {
      setOutputTask(pipeTasks, task.getSource(i), i);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void connect(PipeTasks pipeTasks) {
    Source source;
   
    // Get the input task. A sink only has one input, this corresponds to
    // pipe index 0.
    source = (Source) getInputTask(pipeTasks, 0, Source.class);
   
    // Cast the input feed to the correct type.
    // Connect the tasks.
    source.setSink(task);
   
    // Register the task as an output. A source only has one output, this
    // corresponds to pipe index 0.
    setOutputTask(pipeTasks, task, 0);
  }
View Full Code Here

  public void connect(PipeTasks pipeTasks) {
    // A multi sink receives multiple streams of data, so we must connect
    // them up one by one.
    for (int i = 0; i < task.getSinkCount(); i++) {
      Sink sink;
      Source source;
     
      // Retrieve the next sink.
      sink = task.getSink(i);
     
      // Retrieve the appropriate source.
      source = (Source) getInputTask(pipeTasks, i, Source.class);
     
      // Connect the tasks.
      source.setSink(sink);
    }
   
    // Register the source as an output task.
    setOutputTask(pipeTasks, task, 0);
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void connect(PipeTasks pipeTasks) {
    Source source;
   
    // Get the input task. A sink only has one input, this corresponds to
    // pipe index 0.
    source = (Source) getInputTask(pipeTasks, 0, Source.class);
   
    // Connect the tasks.
    source.setSink(task);
   
    // Register the task as an output. A source only has one output, this
    // corresponds to pipe index 0.
    setOutputTask(pipeTasks, task, 0);
  }
View Full Code Here

  public void connect(PipeTasks pipeTasks) {
    // A multi sink receives multiple streams of data, so we must connect
    // them up one by one.
    for (int i = 0; i < task.getSinkCount(); i++) {
      Sink sink;
      Source source;
     
      // Retrieve the next sink.
      sink = task.getSink(i);
     
      // Retrieve the appropriate source.
      source = (Source) getInputTask(pipeTasks, i, Source.class);
     
      // Connect the tasks.
      source.setSink(sink);
    }
   
    // Register the change source as an output task.
    setOutputTask(pipeTasks, task, 0);
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void connect(PipeTasks pipeTasks) {
    Source source;
   
    // Get the input task. A sink only has one input, this corresponds to
    // pipe index 0.
    source = (Source) getInputTask(pipeTasks, 0, Source.class);
   
    // Cast the input feed to the correct type.
    // Connect the tasks.
    source.setSink(task);
  }
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.translog.Translog$Source

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.