Skip to content
Snippets Groups Projects
Commit b5d7434c authored by anttil's avatar anttil
Browse files

BIS-165 / SP-286: Exporting "for batch update" is very slow

SVN: 28101
parent 92bd7216
No related branches found
No related tags found
No related merge requests found
Showing with 49 additions and 0 deletions
...@@ -121,4 +121,10 @@ public class TypedTableGridColumnDefinitionUI<T extends Serializable> extends ...@@ -121,4 +121,10 @@ public class TypedTableGridColumnDefinitionUI<T extends Serializable> extends
{ {
return header.tryGetVocabulary(); return header.tryGetVocabulary();
} }
@Override
public boolean isCustom()
{
return false;
}
} }
...@@ -140,4 +140,10 @@ public class GridCustomColumnDefinition<T> implements IColumnDefinitionUI<T> ...@@ -140,4 +140,10 @@ public class GridCustomColumnDefinition<T> implements IColumnDefinitionUI<T>
private GridCustomColumnDefinition() private GridCustomColumnDefinition()
{ {
} }
@Override
public boolean isCustom()
{
return true;
}
} }
\ No newline at end of file
...@@ -119,6 +119,7 @@ import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.metaproject.IMetapr ...@@ -119,6 +119,7 @@ import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.metaproject.IMetapr
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.metaproject.MetaprojectIdentifierId; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.metaproject.MetaprojectIdentifierId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.metaproject.MetaprojectTechIdId; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.metaproject.MetaprojectTechIdId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.sample.SampleTechIdId; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.sample.SampleTechIdId;
import ch.systemsx.cisd.openbis.generic.shared.basic.IColumnDefinition;
import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder;
import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId;
import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder;
...@@ -295,6 +296,21 @@ public final class CommonClientService extends AbstractClientService implements ...@@ -295,6 +296,21 @@ public final class CommonClientService extends AbstractClientService implements
// Not directly needed but this refreshes the session. // Not directly needed but this refreshes the session.
String session = getSessionToken(); String session = getSessionToken();
final TableExportCriteria<T> exportCriteria = getAndRemoveExportCriteria(exportDataKey); final TableExportCriteria<T> exportCriteria = getAndRemoveExportCriteria(exportDataKey);
// Remove custom column definitions, as they are not needed in export (and are expensive to
// calculate).
Set<IColumnDefinition<T>> availableColumns = exportCriteria.getAvailableColumns();
Set<IColumnDefinition<T>> nonCustomColumns = new HashSet<IColumnDefinition<T>>();
for (IColumnDefinition<T> def : availableColumns)
{
if (def.isCustom() == false)
{
nonCustomColumns.add(def);
}
}
availableColumns.retainAll(nonCustomColumns);
exportCriteria.getColumnDefs().retainAll(nonCustomColumns);
final GridRowModels<T> entities = fetchCachedEntities(exportCriteria); final GridRowModels<T> entities = fetchCachedEntities(exportCriteria);
EntityKind entityKindForUpdate = exportCriteria.getEntityKindForUpdateOrNull(); EntityKind entityKindForUpdate = exportCriteria.getEntityKindForUpdateOrNull();
if (entityKindForUpdate != null) if (entityKindForUpdate != null)
......
...@@ -223,6 +223,12 @@ public final class CachedResultSetManager<K> implements IResultSetManager<K>, Se ...@@ -223,6 +223,12 @@ public final class CachedResultSetManager<K> implements IResultSetManager<K>, Se
{ {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override
public boolean isCustom()
{
return false;
}
}); });
} }
this.customColumnsProvider = customColumnsProvider; this.customColumnsProvider = customColumnsProvider;
......
...@@ -48,4 +48,7 @@ public interface IColumnDefinition<T> extends IsSerializable ...@@ -48,4 +48,7 @@ public interface IColumnDefinition<T> extends IsSerializable
/** Tries to get specified property or <code>null</code> if not found. */ /** Tries to get specified property or <code>null</code> if not found. */
String tryToGetProperty(String key); String tryToGetProperty(String key);
/** Returns true if this is a custom column */
boolean isCustom();
} }
...@@ -106,4 +106,10 @@ public class TypedTableGridColumnDefinition<T extends Serializable> implements ...@@ -106,4 +106,10 @@ public class TypedTableGridColumnDefinition<T extends Serializable> implements
// The check of index is needed because the column is applied to the wrong model // The check of index is needed because the column is applied to the wrong model
return index < values.size() ? values.get(index) : null; return index < values.size() ? values.get(index) : null;
} }
@Override
public boolean isCustom()
{
return false;
}
} }
\ No newline at end of file
...@@ -1154,6 +1154,12 @@ public final class CachedResultSetManagerTest extends AssertJUnit ...@@ -1154,6 +1154,12 @@ public final class CachedResultSetManagerTest extends AssertJUnit
return "a".equals(key) ? "42" : null; return "a".equals(key) ? "42" : null;
} }
@Override
public boolean isCustom()
{
return false;
}
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment