test_class.file: modules/ml/src/test/java/org/apache/ignite/ml/inference/storage/model/DefaultModelStorageTest.java
test_class.identifier: DefaultModelStorageTest
test_class.superclass: extends AbstractModelStorageTest
test_case.body: @Test
      public void testSynchronizeWithExceptionInLock() {
          Lock[] locks = new Lock[10];
          for (int i = 0; i < locks.length; i++)
              locks[i] = mock(Lock.class);
  
          RuntimeException ex = new RuntimeException();
  
          doThrow(ex).when(locks[5]).lock();
  
          try {
              DefaultModelStorage.synchronize(() -> {}, locks);
              fail();
          }
          catch (RuntimeException e) {
              assertEquals(ex, e);
          }
  
          for (int i = 0; i < locks.length; i++) {
              if (i <= 4) {
                  verify(locks[i], times(1)).lock();
                  verify(locks[i], times(1)).unlock();
              }
              else if (i > 5) {
                  verify(locks[i], times(0)).lock();
                  verify(locks[i], times(0)).unlock();
              }
              else {
                  verify(locks[i], times(1)).lock();
                  verify(locks[i], times(0)).unlock();
              }
  
              verifyNoMoreInteractions(locks[i]);
          }
      }
test_case.class_method_signature: DefaultModelStorageTest.testSynchronizeWithExceptionInLock()
test_case.full_signature: @Test public void testSynchronizeWithExceptionInLock()
test_case.identifier: testSynchronizeWithExceptionInLock
test_case.invocations: mock lock when doThrow synchronize fail assertEquals lock verify times unlock verify times lock verify times unlock verify times lock verify times unlock verify times verifyNoMoreInteractions
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSynchronizeWithExceptionInLock()
focal_class.declarator: storageProvider
focal_class.modifier: private final
focal_class.original_string: private final ModelStorageProvider storageProvider;
focal_class.type: ModelStorageProvider
focal_class.var_name: storageProvider
focal_class.file: modules/ml/src/main/java/org/apache/ignite/ml/inference/storage/model/DefaultModelStorage.java
focal_class.identifier: DefaultModelStorage
focal_class.interfaces: implements ModelStorage
focal_class.class_method_signature: DefaultModelStorage.DefaultModelStorage(ModelStorageProvider storageProvider)
focal_class.full_signature: public  DefaultModelStorage(ModelStorageProvider storageProvider)
focal_class.identifier: DefaultModelStorage
focal_class.modifiers: public
focal_class.parameters: (ModelStorageProvider storageProvider)
focal_class.signature:  DefaultModelStorage(ModelStorageProvider storageProvider)
focal_class.class_method_signature: DefaultModelStorage.putFile(String path, byte[] data, boolean onlyIfNotExist)
focal_class.full_signature: @Override public void putFile(String path, byte[] data, boolean onlyIfNotExist)
focal_class.identifier: putFile
focal_class.modifiers: @Override public
focal_class.parameters: (String path, byte[] data, boolean onlyIfNotExist)
focal_class.return: void
focal_class.signature: void putFile(String path, byte[] data, boolean onlyIfNotExist)
focal_class.class_method_signature: DefaultModelStorage.getFile(String path)
focal_class.full_signature: @Override public byte[] getFile(String path)
focal_class.identifier: getFile
focal_class.modifiers: @Override public
focal_class.parameters: (String path)
focal_class.return: byte[]
focal_class.signature: byte[] getFile(String path)
focal_class.class_method_signature: DefaultModelStorage.mkdir(String path, boolean onlyIfNotExist)
focal_class.full_signature: @Override public void mkdir(String path, boolean onlyIfNotExist)
focal_class.identifier: mkdir
focal_class.modifiers: @Override public
focal_class.parameters: (String path, boolean onlyIfNotExist)
focal_class.return: void
focal_class.signature: void mkdir(String path, boolean onlyIfNotExist)
focal_class.class_method_signature: DefaultModelStorage.mkdirs(String path)
focal_class.full_signature: @Override public void mkdirs(String path)
focal_class.identifier: mkdirs
focal_class.modifiers: @Override public
focal_class.parameters: (String path)
focal_class.return: void
focal_class.signature: void mkdirs(String path)
focal_class.class_method_signature: DefaultModelStorage.listFiles(String path)
focal_class.full_signature: @Override public Set<String> listFiles(String path)
focal_class.identifier: listFiles
focal_class.modifiers: @Override public
focal_class.parameters: (String path)
focal_class.return: Set<String>
focal_class.signature: Set<String> listFiles(String path)
focal_class.class_method_signature: DefaultModelStorage.remove(String path)
focal_class.full_signature: @Override public void remove(String path)
focal_class.identifier: remove
focal_class.modifiers: @Override public
focal_class.parameters: (String path)
focal_class.return: void
focal_class.signature: void remove(String path)
focal_class.class_method_signature: DefaultModelStorage.exists(String path)
focal_class.full_signature: @Override public boolean exists(String path)
focal_class.identifier: exists
focal_class.modifiers: @Override public
focal_class.parameters: (String path)
focal_class.return: boolean
focal_class.signature: boolean exists(String path)
focal_class.class_method_signature: DefaultModelStorage.isDirectory(String path)
focal_class.full_signature: @Override public boolean isDirectory(String path)
focal_class.identifier: isDirectory
focal_class.modifiers: @Override public
focal_class.parameters: (String path)
focal_class.return: boolean
focal_class.signature: boolean isDirectory(String path)
focal_class.class_method_signature: DefaultModelStorage.isFile(String path)
focal_class.full_signature: @Override public boolean isFile(String path)
focal_class.identifier: isFile
focal_class.modifiers: @Override public
focal_class.parameters: (String path)
focal_class.return: boolean
focal_class.signature: boolean isFile(String path)
focal_class.class_method_signature: DefaultModelStorage.getFileStat(String path)
focal_class.full_signature: @Override public FileStat getFileStat(String path)
focal_class.identifier: getFileStat
focal_class.modifiers: @Override public
focal_class.parameters: (String path)
focal_class.return: FileStat
focal_class.signature: FileStat getFileStat(String path)
focal_class.class_method_signature: DefaultModelStorage.lockPaths(Supplier<T> supplier, String... paths)
focal_class.full_signature: @Override public T lockPaths(Supplier<T> supplier, String... paths)
focal_class.identifier: lockPaths
focal_class.modifiers: @Override public
focal_class.parameters: (Supplier<T> supplier, String... paths)
focal_class.return: T
focal_class.signature: T lockPaths(Supplier<T> supplier, String... paths)
focal_class.class_method_signature: DefaultModelStorage.getParent(String path)
focal_class.full_signature: private String getParent(String path)
focal_class.identifier: getParent
focal_class.modifiers: private
focal_class.parameters: (String path)
focal_class.return: String
focal_class.signature: String getParent(String path)
focal_class.class_method_signature: DefaultModelStorage.synchronize(Runnable task, Lock... locks)
focal_class.full_signature: static void synchronize(Runnable task, Lock... locks)
focal_class.identifier: synchronize
focal_class.modifiers: static
focal_class.parameters: (Runnable task, Lock... locks)
focal_class.return: void
focal_class.signature: void synchronize(Runnable task, Lock... locks)
focal_class.class_method_signature: DefaultModelStorage.synchronize(Supplier<T> task, Lock... locks)
focal_class.full_signature: static T synchronize(Supplier<T> task, Lock... locks)
focal_class.identifier: synchronize
focal_class.modifiers: static
focal_class.parameters: (Supplier<T> task, Lock... locks)
focal_class.return: T
focal_class.signature: T synchronize(Supplier<T> task, Lock... locks)
focal_method.body: static void synchronize(Runnable task, Lock... locks) {
          synchronize(() -> {
              task.run();
              return null;
          }, locks);
      }
focal_method.class_method_signature: DefaultModelStorage.synchronize(Runnable task, Lock... locks)
focal_method.full_signature: static void synchronize(Runnable task, Lock... locks)
focal_method.identifier: synchronize
focal_method.invocations: synchronize run
focal_method.modifiers: static
focal_method.parameters: (Runnable task, Lock... locks)
focal_method.return: void
focal_method.signature: void synchronize(Runnable task, Lock... locks)